how to get substring of string without using substr() function in php ????
Answer Posted / abhijit sil
Accessing single characters in a string can be achived
using "curly braces"
<?php
$string = 'abcdef';
echo $string{0}; // a
echo $string{3}; // d
echo $string{strlen($string)-1}; // f
?>
Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What are the features of object-oriented programming in php?
Why is php used?
Which function would you use to read a line of data from a file in php?
How can we access the data sent through the url with the post method?
How to get length of an array in PHP?
Difference between array_combine and array_merge?
What is a namespace in php?
What are variables in research examples?
What is the difference between exception::getmessage and exception::getline?
Does session expire on closing browser?
Is php case sensitive?
What is the definition of a session?
How can I use single quotes in single quotes in php?
What is trait in php?
Write the statements that are used to connect php with mysql