twinklerip Posted August 30, 2006 Share Posted August 30, 2006 Is there a function in PHP that can return substring from a string between 2 given positions.Example:If i'd like the character between postion 3 and 10 from the string "This function may". That result would be "s func"Or is there a function that can trim the characters upto certain positions from the left and another function that can trim the characters to the right from certain position. Link to comment Share on other sites More sharing options...
skym Posted August 30, 2006 Share Posted August 30, 2006 http://www.php.net/substr Link to comment Share on other sites More sharing options...
DeathRay2K Posted August 30, 2006 Share Posted August 30, 2006 For the first you could use $string = "This function may";echo substr($string, 3, 7); Which will produce "s func".Edit: Heh, I guess I took too long. Link to comment Share on other sites More sharing options...
twinklerip Posted August 30, 2006 Author Share Posted August 30, 2006 Thanx.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now