Essential PHP Interview Questions & Answer

php-interview-questions

1) Whats is CURL ? A command line tools for sending and getting files and response. 2) How to use CURL in PHP ? // Step 1 $cSession = curl_init(); // Step 2 curl_setopt($cSession,CURLOPT_URL,”http://www.yahoo.com/search?q=curl”); curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true); curl_setopt($cSession,CURLOPT_HEADER, false); //Step 3 $result=curl_exec($cSession); //Step4 curl_close($cSession); //Step5 echo $result; 3) How to access authenticated WEBSITE Datas in CURL ? // http header: “Authorization: Basic “. base64_encode(“username:password”); // Set the below option for CURL curl_setopt($ch, CURLOPT_USERPWD, ‘username:password’); 4) What is Buffer ? Store all output results into a buffer for improving network performance. Access the…

Read More