IT Community - Software Programming, Web Development and Technical Support

What's the easiest way to remove characters from the end of a string in php?

This is a discussion on What's the easiest way to remove characters from the end of a string in php? within the PHP Programming forums, part of the Web Development category; What's the easiest way to remove characters from the end of a string in php?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-26-2007, 02:52 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Question What's the easiest way to remove characters from the end of a string in php?

What's the easiest way to remove characters from the end of a string in php?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-26-2007, 02:53 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: What's the easiest way to remove characters from the end of a string in php?

//See the function substr():
$rest = substr("abcdef", 1, -1); // returns "bcde"
//so to remove characters from the end of a string you can use:

$rest = substr("abcdef", 0, -2); // returns "abcd"
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove space appearing before the string in textbox? poornima HTML, CSS and Javascript Coding Techniques 5 01-23-2008 04:03 AM
What is the most user-friendly, easiest software to use to create my own Web site? preet HTML, CSS and Javascript Coding Techniques 0 10-04-2007 02:38 AM
How to Get the Right Characters of a string in sql server? kingmaker Database Support 3 08-01-2007 09:07 AM
What is the easiest way to download the contents of a URL with Perl? sivaramakrishnan Perl 1 07-23-2007 04:38 AM
Which Graphics program would you say is easiest ? killerkev06 Web Design Help 8 04-05-2007 03:08 PM


All times are GMT -7. The time now is 02:22 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0