• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Splitting text with php

cheatpark

­
NLC
I have a form which sends some data and then checks a mysql table to see if the data matches. If it matches then it will display the results. What I need to do is to find out how to split the text up into separate bits so that each word is checked separately.
 
hmmm...
you can splid text with substr() (www.php.net/substr)
and you can check stuff if they match with preg_match() and use // to select text in REGEX....
doing /blabla/ will select blabla, then you can use the ! operator to check stuff.

good luck
 
When I use preg_match() I get the following error:

Warning: Delimiter must not be alphanumeric or backslash in c:\www\public_html\search.php on line 16

The code I use is:

PHP:
preg_match("$searchtext/i", "$searchtext");
 
Back
Top