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
Post a Comment