and try to set $content with string value if not string like below
$content = strval($content);
Moreover, i think you are checking for not null
on $content
you can do it like –
//empty is equivalent to !isset($var) || $var == false
if(!empty($content))
{
and flase is considered in following things-
- “” (an empty string)
- 0 (0 as an integer)
- 0.0 (0 as a float)
- “0” (0 as a string)
- NULL
- FALSE
- array() (an empty array)
- $var; (a variable declared, but without a value)