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
I need to know about the courses which are useful in corporate companies.. especially php/mySQL, Java/j2ee, .NET.. also tell if any other courses are valuable
What is php crud api?
Whether php supports microsoft sql server?
What is the use of htmlentities in php?
What is super () python?
What is the correct php command to use to catch any error messages within the code?
What is the best website to learn php?
What is new keyword in php?
How check submit button is clicked in php?
How long is session timeout?
Which is not a file-related function in php?
Tell us why did you choose this particular career path?
What is $_ get and $_ post in php?
Tell me what is the difference between get and post?
What are the benefits of using php and mysql?