Answer the question
In order to leave comments, you need to log in
How to write the response of a function to a variable?
I have a function that cannot be changed, when called, I get an echo in response. Can I somehow write this answer into a variable beforehand, and only then display it? Now the result is not written to the variable, but is displayed immediately.
Example (conditional!):
function test() {
//...
$a = 100;
echo $a;
}
$b = test();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question