Check if String Starts with Substring using PHP

str_starts_with function

<?php

$text = 'Hello world';
$result = str_starts_with($text, 'Hello');

echo $result ? 'Yes' : 'No';

Leave a Comment

Cancel reply

Your email address will not be published.