this question has answer here:
- how check if string contains specific word? 38 answers
hi want find if string content "|" character.
example:-
$string = '$18,000 | new price'; if (preg_match('/[^|]/', $string)) { } else { }
this should work.
$string = '$18,000 | new price'; if (strpos($string , '|') === false) { // not found. } else { // found. }
Comments
Post a Comment