php formated Print statement Get link Facebook X Pinterest Email Other Apps July 09, 2021 $num = 5;$location = 'tree';$format = 'There are %d monkeys in the %s';echo sprintf($format, $num, $location); Get link Facebook X Pinterest Email Other Apps Comments
JQuery - setTimeout July 09, 2021 set time out function. setTimeout(function(){ alert("Hello"); }, 3000); 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