Write a PHP program to check if a given string starts with a given substring
<?php //Licence: https://bit.ly/2CFA5XY function startsWith($haystack, $needle) { return strpos($haystack, $needle) === 0; } print_r(startsWith('Hi, this is me', 'Hi')); ?>
Sample Output:
1
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer