:glare: Hi everybody,
Can you help me with this please:
I'm using a search function to search for a certain keywords and what I need it's to remove any spaces and any of theses words(and|or|not). Then after inserting these into the database.
These is the code:
$new_keyword=preg_split('( and | or | not )', $keywords, -1 , PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
print_r($new_keyword);
foreach($new_keyword as $k=>$v){
$s1="INSERT INTO Searches (Search, DateAdded) VALUES(\"".$v."\", NOW())";
db_q($s1);
}
It remove and|or|not but not the spaces
THANKS