php - string is not getting printed and showing error of division by zero -


string $unencodeddata; not getting printed , showing error of division zero

       $date = date_create();         $timestamp= date_timestamp_get($date);          $rand = mt_rand(100000,999999);          $string = "cp-string";            $unencodeddata = "cp-string"/'.$timestamp.'/'.$rand.';          echo $unencodeddata;               file_put_contents('./public/image/share/image.png',file_get_contents('$unencodeddata')); 

dont know code wrong.. hinking may wrong in declaring $unencodeddata;

it simple case of miss-matched quote pairs think wanted :

$unencodeddata = 'cp-string/'.$timestamp.'/'.$rand;

also please note if don't care little overhead can use following make code little more readable :

$unencodeddata = "cp-string/$timestamp/$rand";


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -