piyush23424 Posted January 30, 2010 Share Posted January 30, 2010 The value of a local variable of a function has to be retained over multiple calls to that function. How should that variable be declared? Link to comment https://forums.phpfreaks.com/topic/190363-general-question-regarding-php/ Share on other sites More sharing options...
Mchl Posted January 30, 2010 Share Posted January 30, 2010 static Link to comment https://forums.phpfreaks.com/topic/190363-general-question-regarding-php/#findComment-1004252 Share on other sites More sharing options...
dpacmittal Posted January 30, 2010 Share Posted January 30, 2010 function a(){ static $a; //This will be retained } Link to comment https://forums.phpfreaks.com/topic/190363-general-question-regarding-php/#findComment-1004310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.