Answers for "php in sting"

PHP
8

string contains php

$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
Posted by: Guest on October-18-2020
0

like %% inside the string php

strpos('STRING', 'SEARCH_ITEM');

--------------OR--------------------
  
preg_match('~' . preg_quote('.SEARCH_ITEM.', '~') . '~', 'STRING');
Posted by: Guest on September-27-2020

Browse Popular Code Answers by Language