Find out if function has any output with php

Posted by Keith Donegan on Stack Overflow See other posts from Stack Overflow or by Keith Donegan
Published on 2010-04-14T16:47:10Z Indexed on 2010/04/14 16:53 UTC
Read the original article Hit count: 139

Filed under:
|
|

Quick one for you guys.

Say I have a function that outputs a string:

function myString()
{
      echo 'Hello World';
}

How would I go about testing to see if the function outputs any data?

if(myString() ==''){ 
      echo ''Empty function;  
}

© Stack Overflow or respective owner

Related posts about php

Related posts about function