PHP User defined function
Moderator: General Moderators
PHP User defined function
hi
is there any way to inlude the userdefined function in to PHP predefined lib function ,please let me know the same ,advance thanks for valuable solution...
regards
Sujith
is there any way to inlude the userdefined function in to PHP predefined lib function ,please let me know the same ,advance thanks for valuable solution...
regards
Sujith
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Oh right! You really should look at the manual on functions
Code: Select all
function add($a, $b) {
return $a + $b;
}
Last edited by Ollie Saunders on Fri Aug 11, 2006 7:06 am, edited 1 time in total.
You don't need to modify the PHP source to add your own functions to PHP's library. Just put them in a PHP file, defined as usual with function() { } blocks, and then use PHP's auto_prepend directive to include that file on every page.
http://www.zend.com/zend/spotlight/prepend.php
http://www.zend.com/zend/spotlight/prepend.php