how to remove tags from the returned php result?
<p>in my android app i return some data from my MYSQL data base through a php script and if the returned result was null : it will be returned to my app in this format :</p>

<pre><code>result&lt;br /&gt;&lt;font size='1'&gt;&lt;table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'&gt;&lt;tr&gt;&lt;th align='left' bgcolor='#f57900' colspan="5"&gt;&lt;span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'&gt;( ! )&lt;/span&gt; Notice: Undefined variable: output in C:\wamp\www\y.php on line &lt;i&gt;16&lt;/i&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th align='left' bgcolor='#e9b96e' colspan='5'&gt;Call Stack&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th align='center' bgcolor='#eeeeec'&gt;#&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Time&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Memory&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Function&lt;/th&gt;&lt;th align='left' bgcolor='#eeeeec'&gt;Location&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td bgcolor='#eeeeec' align='center'&gt;1&lt;/td&gt;&lt;td bgcolor='#eeeeec' align='center'&gt;0.0005&lt;/td&gt;&lt;td bgcolor='#eeeeec' align='right'&gt;368264&lt;/td&gt;&lt;td bgcolor='#eeeeec'&gt;{main}(  )&lt;/td&gt;&lt;td title='C:\wamp\www\y.php' bgcolor='#eeeeec'&gt;..\y.php&lt;b&gt;:&lt;/b&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/font&gt;" not exist"
</code></pre>

<p>this word : " not exist"   i added  it in my php through an if statement to check result  if its null, i want to replace it by string value which is  " not exist" , and in my app i will handle  it rather than handling  null value which will cause  JSON Exception since the null value or value in this foramt cant be parsed to JSON array 
my question is : how i can remove all the tags returned with the result ?  if the $output was null i replaced it with  " not exist" but it didnt return  in JSON format as in case it has value ,why  ?  please help me since i am new in php...</p>

<p><strong>php code</strong> </p>

<pre><code>$name=$_REQUEST['Name'];          
     mysql_connect("localhost","user","pass")or OnError('database connection failed', mysql_error());
    mysql_select_db("MYDB")or OnError('database selection failed', mysql_error($mysql));
    mysql_query("SET NAMES utf8"); 
   $sql=mysql_query("select  burnedCalories   from Exercise where  Name='$name' ");
   while($row=mysql_fetch_assoc($sql))
   $output[]=$row;
   if (is_null($output))  // if the exercise name not exist the result will be null
    {                                
      $output = ' not exist';
    }
    print(json_encode($output));
     mysql_close();
    define('DEBUG_DETAILS', true);
    function onError($msg, $details) {
    $msg = array(
    'status'=&gt;'error',
    'message'=&gt;$msg);
if ( defined('DEBUG_DETAILS') &amp;&amp; DEBUG_DETAILS ) {
    $msg['details'] = $details;
}
die(json_encode($msg));}
     ?&gt;
</code></pre>
