I'm trying to join an array so it appears as a list with: $method = strip_tags(mysql_real_escape_string($_POST[forminput])); $method = implode("</li><li>", $method); $method = "<li>".$method."</li>"; PHP: but it's not liking this approach and tells me parameter 1 of implode is an array where as it should be a string??
you cannot use mysql_real_escape_string and strip_tags with an array type of variable.. it should be a string.. and also.. don't use mysql_real_escape_string if you're not using it in a mysql query.. you can read it's definition here.. http://www.php.net/manual/en/function.mysql-real-escape-string.php
Well it is to be used in a query but that's a few lines down, I prefer not to share my queries for security The problem was the functions being in the wrong order, if you do the mysql_real_escape_string last on the completed string then it works fine! $ingrediants = "<li>".mysql_real_escape_string(strip_tags(implode("</li><li>", $_POST[ingrediants]), "<li>"))."</li>"; PHP: