PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 2nd, 2000, 08:58 AM
fantom
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I just want to know how can I delete the last character from a variable (not array or anything complicated) using ereg_replace() or something similar... please help.

Reply With Quote
  #2  
Old June 2nd, 2000, 09:14 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
you can simply get using a substr function

$var="I Love My Jesus,";

$var=substr($var,0,length($var)-1);

#get first character to 2nd last one



------------------
SR -
shiju.dreamcenter.net

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #3  
Old June 2nd, 2000, 10:01 AM
fantom
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I guess PHP3 doesn't support that function length() cuz I'm getting errors when using it ("unsupported ...").
Any clue...?

Reply With Quote
  #4  
Old June 2nd, 2000, 11:33 AM
falcon falcon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: UK
Posts: 50 falcon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 21 m 33 sec
Reputation Power: 14
Hi,

Try strlen()

It wouldn't be that hard to find the function yourself on the PHP site.

Falcon

Reply With Quote
  #5  
Old June 2nd, 2000, 03:22 PM
fantom
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanx, that's just what I needed.
Appreciate it...

Reply With Quote
  #6  
Old June 3rd, 2000, 04:31 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
fantom,
sorry,length() won't work with it.

just i written like in perl..


------------------
SR -
shiju.dreamcenter.net

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > This might sound dumb, but I need help with it...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap