Answers for "if in string like php"

PHP
6

php find if string contains

if (strpos($string, 'substring') !== false) {
	// do stuff 
}
Posted by: Guest on August-25-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