jd2007 Posted August 11, 2007 Share Posted August 11, 2007 In a function i create myself, how can i make the parameters in that function optional ? Link to comment https://forums.phpfreaks.com/topic/64357-solved-in-a-function-i-create-myself-how-can-i-make-the-parameters-optional/ Share on other sites More sharing options...
teng84 Posted August 11, 2007 Share Posted August 11, 2007 function($teng=" "){ } Link to comment https://forums.phpfreaks.com/topic/64357-solved-in-a-function-i-create-myself-how-can-i-make-the-parameters-optional/#findComment-320893 Share on other sites More sharing options...
trq Posted August 11, 2007 Share Posted August 11, 2007 You can also set defaults by using... function ($a='foo') { Also... remember, any optional arguments must come after required ones. Link to comment https://forums.phpfreaks.com/topic/64357-solved-in-a-function-i-create-myself-how-can-i-make-the-parameters-optional/#findComment-320897 Share on other sites More sharing options...
jd2007 Posted August 11, 2007 Author Share Posted August 11, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/64357-solved-in-a-function-i-create-myself-how-can-i-make-the-parameters-optional/#findComment-320901 Share on other sites More sharing options...
teng84 Posted August 11, 2007 Share Posted August 11, 2007 i guess time to mark this as solved Link to comment https://forums.phpfreaks.com/topic/64357-solved-in-a-function-i-create-myself-how-can-i-make-the-parameters-optional/#findComment-320902 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.