curl api using variable post/get method

HI every one there are lot of confusion about curl may be you understand easily …    $url= “phone=$phone&leadid=$leadid”; //initialized other variable $header = array(“Accept: application/json”);                        //optional for json format. $ch = curl_init();                        … Read more

convert backslash to forward slash vice versa

Hi Guys, this is very easy method to replace the special character with in string  . Example $var  = “/var/xyz/html/uploaddata/xyz.html”; “/”replace with “-”  $str = str_replace(‘/’, ‘-‘,  $var); result is -var-xyz-html-uploaddata-xyz.html Example     $var  = “var-xyz-html-uploaddata-xyz.html”; “-“replace with “/” $str = str_replace(‘-‘, ‘/’,  $var); result is /var/xyz/html/uploaddata/xyz.html “/”replace with “\”  Example $var  = “/var/xyz/html/uploaddata/xyz.html”; $test = str_replace(‘/’, “\\”, $var … Read more

Convert datetime to specific formats in PHP

There are many way to use date time with specific combination with format  in PHP.. dd/mm/yyyy 18/04/2016 $userdefine = date(“d/m/Y”, $datetime); echo $userdefine; mm/dd/yyyy 04/18/2016 $userdefine= date(“m/d/Y”, $datetime); echo $userdefine; Without mins/seconds 18 April 2016  $userdefine= date(“d F Y”, $datetime); echo $userdefine; With mins/seconds 18 April 2016 10:12:59  $userdefine= date(“d F Y H:i:s”, $datetime); echo $userdefine;   There are same other formats like $userdefine= date(“m-d-Y”, $datetime); echo $userdefine; —output like … Read more

PHP Video File Upload in Server

Configure The “php.ini” File in local server or Linux ,Centos.for In your “php.ini” file, search for the file_uploads directive, and set it to On: For centos or linux you need to configure the these changes in server. /etc/php.ini upload_max_filesize = 2M file_uploads = On change the upload_max_filesize = userdefine size ;upload_tmp_dir = uncomment the variable … Read more