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 csrf validation?
What does nan stand for computer science?
What is the use of offset in mysql?
Is laravel easy to learn?
Write a php function to convert all null values to blank?
Explain how to submit form without a submit button.
Which software is used to run php programs?
How can you get the size of an image in PHP?
What is the difference between html and php?
Tell me how is it possible to know the number of rows returned in result set?
Does php need apache?
What the use of var_dump()?
Who is the father or inventor of php?
Suppose the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
How big is nvarchar max?