How can I check every character on a string on php?
For example I have this string.
$a = "sd qwerty utr";
I want to know the first of the string and get the 1st 3 characters, then I want to get the last 4 characters of the string.
The output will be "sd qwe utr".
There are two ways (your question doesn’t match your description):
You can use an index to get to each character individually:
You can use
substr()to get pieces of the string: