php - catch constants as type string -


i have function takes constant string , know if possible obtain value of constant referent.

myfunction( "fetch_assoc" )
argument related pdo::fetch_assoc

is possible?
i'm putting class work database, thanks

yes, can use constant function.

note has full qualifier though. constant("pdo::fetch_assoc"), not constant("fetch_assoc") (unless want constant named fetch_assoc in global namespace, not in pdo class).


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -