A
A
Alexander2016-01-19 13:54:57
PHP
Alexander, 2016-01-19 13:54:57

How to convert string to php function call?

Essence of the question. The PHP class has a load_function method that takes a string variable as an argument - the name of the method, how can it be fashionable to make functions (methods) run simply by converting their name into a call in autoload mode, without checking the contents of the variable?

public function load_function($function_name){
       // здесь необходимо написать код 
       // который преобразует строковую переменную $function_name в вызов функции
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-01-19
@sHinE

If I understood the question correctly, then php.net/manual/en/function.call-user-func.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question