
Create a function to check whether a string begins with the specified string or not. The function should return TRUE on success or FALSE on failure.
The following is the syntax −
begnWith(str, begnStr)
Consider the following parameters in it to check −
-
str − The string to be tested
立即学习“PHP免费学习笔记(深入)”;
begnStr − The text to be searched in the beginning of the specified string.
Example
The following is an example −
Live Demo
输出
以下是输出 −
True! It begins with p!











