Getting the chunks, dynamic number
Posted: Wed Mar 24, 2004 6:18 pm
I'm having some probs with a search type form. 
I have on one page a form with a textbox named "searchterms". On the search.php page (which you upload to) I have:
And I'm stuck...hehe...
I need to be able to get the exploded terms into an array or something, so that I can search for them in the DB. For example, the user enters "Joe Smith car". I need PHP to pick out "Joe", "Smith", and "car". I just don't know how to pick them out and put them into an array.
If you have a better method, please share.
I have on one page a form with a textbox named "searchterms". On the search.php page (which you upload to) I have:
Code: Select all
<?php
$searchterms = $_POST['searchterms'];
$chunkTerms = explode(" ", $searchterms);
?>I need to be able to get the exploded terms into an array or something, so that I can search for them in the DB. For example, the user enters "Joe Smith car". I need PHP to pick out "Joe", "Smith", and "car". I just don't know how to pick them out and put them into an array.
If you have a better method, please share.