Broken Explode?
Posted: Sun Dec 11, 2011 2:01 pm
I have the following code from the database search tutorial and I seem to be getting empty arrays from it - Yet I can't see why!?
Any help would be great!
Any help would be great!
<?php function search_posts($term){ echo "keywords entered was $term<br/>"; $keywords=explode(' ', mysql_real_escape_string($term)); print_r($keywords); } ?> <form action="test.php" method="get"> <input type="text" name="term" /><br /> <input type="submit" value="Search" /> </form> <?php if(empty($_GET['term']) === false){ search_posts($_GET['term']); } ?>