Skip to main content
deleted 4 characters in body
Source Link
Krzysiek Dróżdż
  • 25.5k
  • 9
  • 53
  • 74

Any ideas? Where is the function that needs to be returned instead of echoed?

I'm going to offer an alternative solution that does not require you to replace instances of echo or build a return string.

You can turn on output buffering and return the buffer as a string.

Add ob_start() to the beginning of the function before any echo call.

at the end of the function add:

$response = ob_get_contents();
        ob_end_clean();
        return $response;

Any ideas? Where is the function that needs to be returned instead of echoed?

I'm going to offer an alternative solution that does not require you to replace instances of echo or build a return string.

You can turn on output buffering and return the buffer as a string.

Add ob_start() to the beginning of the function before any echo call.

at the end of the function add:

$response = ob_get_contents();
        ob_end_clean();
        return $response;

Any ideas? Where is the function that needs to be returned instead of echoed?

I'm going to offer an alternative solution that does not require you to replace instances of echo or build a return string.

You can turn on output buffering and return the buffer as a string.

Add ob_start() to the beginning of the function before any echo call.

at the end of the function add:

$response = ob_get_contents();
ob_end_clean();
return $response;
Source Link
Chris_O
  • 20.6k
  • 5
  • 61
  • 95

Any ideas? Where is the function that needs to be returned instead of echoed?

I'm going to offer an alternative solution that does not require you to replace instances of echo or build a return string.

You can turn on output buffering and return the buffer as a string.

Add ob_start() to the beginning of the function before any echo call.

at the end of the function add:

$response = ob_get_contents();
        ob_end_clean();
        return $response;