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

Explain how is it possible to set an infinite execution time for php script?

924


What is the use of dual table in mysql?

915


What’s the difference between htmlentities() and htmlspecialchars()?

994


Tell me how to set a page as a home page in a php based site?

886


Tell me how do you define a constant?

895


What is call by reference in php?

962


How to read one character from a file?

1038


Declare a new variable in php equal to the number 3;

882


Tell me are parent constructors called implicitly inside a class constructor?

895


Which function parses an English textual date or time into Unix timestamp in PHP.

954


What is $_ request in php?

842


How to set cookies in PHP?

1039


What is xss in php?

950


When do sessions end?

900


What is the difference between characters 34 and x34?

852