하위 문자열이 문자열에있는 경우 php 찾기
$result = strpos("haystack", "needle");
if ($result != false)
{
// text found
}
php 바늘 건초 더미
//Find the position of the first occurrence of a substring in a string
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
배열 찾기 php
array_search ( mixed $needle , array $haystack , bool $strict = false ) : int|string|false
<?php
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array); // $key = 1;
?>