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
Distinguish between urlencode and urldecode?
Does mysql need php?
What does namespace mean in php?
What is the use of magic function in php?
How can you compare objects in php?
How many types of functions are there in php?
How do you compare strings in java?
What are classes in php?
How to set a value in session? How to remove data from a session?
Explain the changes in php versions?
What is a path Traversal?
Is php fully object oriented?
Explain me what are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
Php program to generate fibonacci series?
What is the use of preg_match in php?