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

How to access a specific character in a string?

987


What is htaccess in php?

1283


Is php 7.0 stable?

930


Write down the code for save an uploaded file in php.

974


What is 'float' property in css?

996


What is a string in r?

933


How to convert strings to upper or lower cases?

1004


What is constructor and destructor?

971


How to find the position of the first occurrence of a substring in a string?

1013


what does this symbol mean in php?

1149


Can you specify the "new line" character in single-quoted strings?

966


How to declare an array in php?

1096


What is the use of friend function in php?

977


How to specify argument default values?

977


How to stop the execution of php script?

975