how to find caracter in string in php code example
Example 1: strpos in php
<?php
// We can search for the character, ignoring anything before the offset
$newstring = 'abcdef abcdef';
$pos = strpos($newstring, 'a', 1); // $pos = 7, not 0
?>
Example 2: check if string contains substring php 8
str_contains('STRING', 'SUB_STRING');