Jump to content

Custom Function and variables


mwl707

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.