Hi, I need to be able to split a search terms and then use it to query the database. If i enter one search term it works fine but I when two are enetered it doesnt work.
Do I use explode() or preg_match() can someone please help.
Explode could be used. However explode needs a separator character to split the string.
Supposing your separator character is a space:
Code:
$searchterms=explode(" ",$_POST['forminput']);
This will then give you an array with the keywords.
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.