Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function myfunction () {
- echo 'hello world<br>';
- }
- call_user_func('myfunction');
- function myfunction1 ($arg) {
- echo 'hello world' . $arg . '<br>';
- }
- call_user_func('myfunction1', '2018');
- class Myclass {
- public function testUserFunc() {
- // you can call a function from outside your class
- call_user_func('myfunction');
- }
- }
- $myclass = new Myclass;
- $myclass->testUserFunc();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement