if string have character php code example
Example 1: php check if string or number
<?php if (is_numeric("cake")) { echo "Yes"; } else { echo "No"; } ?>
Example 2: javascript check if string ends with
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
endsWith("hello young man","man");//true
endsWith("hello young man","boy");//false