mwl707 Posted May 9, 2009 Share Posted May 9, 2009 Hi Can anyone help me please. I have written a custom function into my code . After calling it I cannot get the value of the variables after I have used the function. I have wrote an example code below of the problem and when it is run nothing appears on the screen. Cheers Mick ????? function example($day) { $new_day = $day + 2 ; $other_day = $new_day-10 // etc } ; // code $day = 10 ; example ($day) ; echo $new_day ; // nothing on screen ?? echo $other_day ; // nothing on screen ?? Link to comment https://forums.phpfreaks.com/topic/157491-custom-function-and-variables/ Share on other sites More sharing options...
Mchl Posted May 9, 2009 Share Posted May 9, 2009 http://www.php.net/manual/en/language.variables.scope.php Link to comment https://forums.phpfreaks.com/topic/157491-custom-function-and-variables/#findComment-830312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.