Answers for "php string starts with regex"

PHP
5

php string starts with

//php check if first four characters of a string = http
substr( $http, 0, 4 ) === "http";
//php check if first five characters of a string = https
substr( $https, 0, 5 ) === "https";
Posted by: Guest on September-01-2020
0

php regex strin start with

$string = "amora";
$result = preg_match("#^amor(.*)$#i", $string);
if($result == 0)
{
    echo "No match";
}
else
{
    echo "Match found.";
}
//out: Match found.
Posted by: Guest on September-10-2021

Code answers related to "php string starts with regex"

Browse Popular Code Answers by Language