PHP ERROR Reporting Get link Facebook X Pinterest Email Other Apps May 16, 2021 ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); Get link Facebook X Pinterest Email Other Apps Comments
Linux command line search and replace string in all files May 17, 2021 String Find and replace (folders/sub folders) > grep -rl "old string" . | xargs sed -i 's/old string/new string/g' URL Find and replace (folders/sub folders) > grep -rl "www\.google\.com" . | xargs sed -i 's/www\.google\.com/www\.yahoo\.com/g' Find string > grep -iRl "search string" /path/lcoation Read more
PHP - CURL POST May 14, 2021 CURL POST $post_data_arr = [ 'f_name' => 'First', 'l_name' => 'Last', ]; $url = 'http://example.com'; $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data_arr); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl); print_r($response); CURL POST with authentication $url = 'http://example.com'; $username = "username"; $password = "password"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 2); curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data_arr); $response = curl_exec($curl); curl_close($curl); print_r($response); Read more
Comments
Post a Comment