function through variable in PHP? |
function through variable in PHP? |
CodeKing |
Jan 26 2008, 08:01 PM
Post
#1
|
Advanced Member Group: Members Posts: 175 Joined: 12-September 06 Member No.: 118 |
Anyway to do something like this?
CODE function hello() { echo 'hello'; } function run_func($func) { //Run the function set to $func } $hello_func = hello; run_func($hello_func); You can do it in javascript. Can you do it in PHP? |
Brian Chandler |
Jan 27 2008, 03:51 AM
Post
#2
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Have you looked in the php manual? That's normally the way to do programming - read the specification of what the programming language does, rather than just guessing.
|
Lo-Fi Version | Time is now: 24th April 2024 - 09:46 AM |