Question about defining functions.

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!

Moderator: General Moderators

Post Reply
dwnthk
Forum Newbie
Posts: 13
Joined: Mon Oct 08, 2007 5:55 am

Question about defining functions.

Post by dwnthk »

Hi there,

In php.net, I saw some codes like this:

Code: Select all

function abc_123(...) { ... }
   function _abc_123(...) { ... }
In the page, it is used like this:

Code: Select all

echo abc_123(...)
I am not sure what does _abc_123() mean? Is it the overloading of the function abc_123()? When does the function _abc_123() will be called?

Thanks guys. :D


Dave
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

what was the URL of this page?

According to http://php.net/functions:
PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions.
But class methods can be overloaded:
http://php.net/language.oop5.overloading
dwnthk
Forum Newbie
Posts: 13
Joined: Mon Oct 08, 2007 5:55 am

Post by dwnthk »

Sorry about this. :oops: Now I saw the _abc_123() has been called in the abc_123().

Most of the time, I will go to http://www.php.net to find resources I needed.

I am trying to figure out how the regular expression is used in the preg_replace(). I got so confused on the pattern like "/\\&\\#([0-9]{3,10})\\;/e" blah blah blah, you know... Can anyone has me a short explanation?

Thanks.


Dave
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

there's no "quick overview" of regular expressions, it's a very expressive language to say the least.

Check out http://www.regular-expressions.info

If you have any specific questions, post in the regex forum.[/url]
Post Reply