PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php function Content() { ?>
This is my content
<?php } ?>
<?php include("template.php");?> //pulls in the template file
This works fine but what i want to do is have a function defined in template.php that checks to see if the function exists. If the function exisits then it continues, if the function does not exist it retuns a blank for the function.
The reason for wanting to do this is I can then define multiple calls for different functions in my template page and only populate them if they are defined in the page including the template.php reference.
Hope that makes sense
Last edited by smoogle on Thu Jul 20, 2006 11:00 am, edited 1 time in total.
Yeah, sometimes they get it right, and other times, not so much (sprintf - what the hell does that do?). Same for the argument passing... do I search for a needle in a haystack or do I search the haystack for a needle? Consistency would be nice, but alas, PHP is free so I can't complain.
Which is all well and good for C programmers. But for us PHP hicks from the other side of the tracks, sprintf tells me nothing. Now, isnumeric or in_array, they tell me something...
Thanks very much and sorry for asking a dumb question....being a such a newbie and all ...
How do I get the php page to continue running the code if it see that the function doesn't exist.... have a feeling this is going to be another no brainer.... sorry in advance...
I don't want to make it appear that I don't know what they do. I was just using them as an example of how some functions are named versus other named functions. To the novice, function_exists() seems to make sense. If you were a new developer, this would kinda tip you off as to what is happening with it. Others, like sprintf(), don't exactly do that. That's the point I was trying to make.