Unable to add a var in a php function -



Unable to add a var in a php function -

i new php running problem following: trying add together $var in strtotime() function. such:

$var= $_post['yyyy'] . $_post['mm'] . $_post['dd']; //function function blah() { strtotime($var); $time = $date -time(); $numberofdays = ceil($time / 86400); homecoming $numberofdays; }

how set $var in strtotime function?

$var out of scope function. need pass parameter function have access it. you're missing declaration , assignment of value $date assuming first line of function.

$var = $_post['yyyy'] . $_post['mm'] . $_post['dd']; function blah($var) { $date = strtotime($var); $time = $date -time(); $numberofdays = ceil($time / 86400); homecoming $numberofdays; } echo blah($var);

php function

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -