Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Distinguish between urlencode and urldecode?

1047


Does mysql need php?

969


What does namespace mean in php?

1069


What is the use of magic function in php?

1014


How can you compare objects in php?

997


How many types of functions are there in php?

1247


How do you compare strings in java?

981


What are classes in php?

1149


How to set a value in session? How to remove data from a session?

1037


Explain the changes in php versions?

1023


What is a path Traversal?

1091


Is php fully object oriented?

983


Explain me what are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

1200


Php program to generate fibonacci series?

1105


What is the use of preg_match in php?

1041