I'm calling a function that prints an output using "echo". for example:
function a(){
echo 'example output';
}
problem is I don't have any control over this function and can't edit it. but I need to store the function's output to a variable like so:
$myVar = a();
// $myVar should now be 'example output'
I need to prevent the function from printing anything to the screen but I need it's output in $myVar.
is there anyway to achieve this?