calling 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
CodeEye
Forum Commoner
Posts: 25
Joined: Fri Jul 05, 2002 7:19 am

calling functions

Post by CodeEye »

this may seem like a funny question but how how i call a function when i store the name if a varible e.g.

function getfunc(id)
id() ;
}

havent tested this but i don't think it would work ?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

That wouldn't work - what exactly are you trying to do?

Mac
CodeEye
Forum Commoner
Posts: 25
Joined: Fri Jul 05, 2002 7:19 am

Post by CodeEye »

if is for my xml parser i know what the names are going to be called so i have built a function for each rather than having a big switch statement i hope to just call the function depending on the name like the
opening and closing of the
xml_set_element_handler($xml_parser, "startElement", "endElement");

function
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I think that this is what you are looking for:
http://www.php.net/manual/en/functions. ... ctions.php

Mac
Post Reply