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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -