In this Php tutorial 6, we are gonna to study about php basic string functions that a developer must know.
The two main string functions in php are
- String Length
- String Position
String Length:
This function is used to find the length of the string.
Syntax:
- strlen("string") or strlen(stringname)
Example:
Output:
16
5
5
String Position:
This function is used to find the position of the string.
Syntax:
- strpos("string","a letter or word to find its position");
8
12
12
Note : Count of string will be start by 0.
No comments:
Post a Comment