Reputation: 11285
I am trying to take a variable from $_POST
, run mysql_real_escape_string
and a custom function, html2text
on it. This should work, right? Or do I need to separate it on separate lines?
$orgname = mysql_real_escape_string(html2txt($orgname)) = $_POST['orgname'];
Upvotes: 0
Views: 38
Reputation: 29424
That won't work because you can't use the functions return value in write context:
Fatal error: Can't use function return value in write context
This code should work (and is more cleaner):
$orgname = mysql_real_escape_string( html2txt($_POST['orgname']) );
Upvotes: 1
Reputation: 82594
Are you trying to do this:
$orgname = mysql_real_escape_string(html2txt($_POST['orgname']));
Upvotes: 3