// Declare the regex pattern
$pattern = "/^htt+p$/";
// Test strings
$testStrings = ["http", "htttp", "httttp", "httpp", "htp"];
// Check matches
foreach ($testStrings as $test) {
$match = preg_match($pattern, $test);
echo "Matches \"$test\": " . ($match ? "true" : "false") . "\n";
}
// Matches "httpp": True or false, depending on how matches() method works
/*
run:
Matches "http": true
Matches "htttp": true
Matches "httttp": true
Matches "httpp": false
Matches "htp": false
*/