I'm calling a function which performs a redirect at the end. Can i prevent the function i called from performing a redirect somehow?
function a() {
// here i would want to prevent the redirect. but i must call b always
b();
return 'a';
}
//function that i can't modify. It always redirects.
function b() {
header("Location: http://google.com", true, 200 );
}
$return = a();
echo $return;
// expected output: 'a' not a redirect to google
If you ask why, i would not want to modify function b()
as it's a library function.