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
How to generate a form?
What are the common uses of php?
Is string php function?
Tell me how to set a page as a home page in a php based site?
How To Get the Uploaded File Information in the Receiving Script?
Explain the difference between $message and $$message?
Can a super () and this () keywords be in same constructor?
What is the function of mysql_real_escape_string in php?
What is the best practice for running mysql queries in php? Consider the risk of sql injection.
What is the use of strip_tags() method?
Does php need html?
Can I use php in html?
What are the differences between GET and POST methods?
What is difference between put and post method in http?
What is meant by pear in php? What is the purpose of it?