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

I need to know about the courses which are useful in corporate companies.. especially php/mySQL, Java/j2ee, .NET.. also tell if any other courses are valuable

1923


What is php crud api?

936


Whether php supports microsoft sql server?

1032


What is the use of htmlentities in php?

969


What is super () python?

1021


What is the correct php command to use to catch any error messages within the code?

1063


What is the best website to learn php?

967


What is new keyword in php?

933


How check submit button is clicked in php?

1012


How long is session timeout?

993


Which is not a file-related function in php?

1036


Tell us why did you choose this particular career path?

938


What is $_ get and $_ post in php?

1056


Tell me what is the difference between get and post?

959


What are the benefits of using php and mysql?

975