How can I use the curl_exec function to execute a cURL session and get the response in PHP? Example code: - Biz Tech

How can I use the curl_exec function to execute a cURL session and get the response in PHP? Example code:

Listen
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://example.com");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

echo $response;