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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -