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 is chrome logger?
What are the features of php 7?
What is exception handling in php?
Swap two variables value without using third variable in php ?
Is empty array php?
What is difference between session and cookies in php?
What is a trait in php?
Why we use get in php?
What is difference between required and include in php?
What is form submission?
How many keywords are there in php?
Do you know what is the function mysql_pconnect() usefull for?
How many types of array are there in php?
What is the content of /etc directory?
How to set cookies?