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 advantages of php?
List types of array are available in php?
What is difference between action hook and filter hook?
Do I need to install php after xampp?
How to run the interactive php shell from the command line interface?
What does pear stand for?
Which php global variable is used for uploading a file?
What are the different tables(engine) present in mysql, which one is default?
What is csrf verification?
How to change the principal password?
How are cookies created?
Explain the differences between get and post methods?
Why php is used in html?
What is echo in html?
Which is better php or wordpress?