Answers for "php match part of string"

PHP
2

find substring in string php

pos = strpos($current_url, "workspace/detail/live-streaming/service") 
=> if pos > 0 found with the current position pos 
=> if pos < 0 not found
=> if pos = 0 => found with current position = 0;
Posted by: Guest on October-19-2021
-2

string match in php

//str_contains ( string $haystack , string $needle ) : bool

if (str_contains('Foo Bar Baz', 'Foo')) {
  echo 'Found';
}
Posted by: Guest on April-18-2021

Browse Popular Code Answers by Language