- Joined
- Feb 22, 2006
- Messages
- 1,520
- Reaction score
- 0
I want to overload a few functions but since php doesn't support it I was wondering if there was a work around where if I don't set a parameter it will only run a certain portion of the function or something along those lines.
Any ideas on how to do this?
Example of what I wish I could do:
Any ideas on how to do this?
Example of what I wish I could do:
PHP:
<?php
function foo($str){
echo "Only one paramter is set";
}
function foo($str,$str2){
echo "Both parameters are set";
}
?>