#1
  1. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    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.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    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..."
  4. #3
  5. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    I guess PHP3 doesn't support that function length() cuz I'm getting errors when using it ("unsupported ...").
    Any clue...?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    15
    Hi,

    Try strlen()

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

    Falcon
  8. #5
  9. No Profile Picture
    fantom
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanx, that's just what I needed.
    Appreciate it...
  10. #6
  11. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    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..."

Similar Threads

  1. Problems with sound.
    By selectedcrack in forum Linux Help
    Replies: 1
    Last Post: January 15th, 2004, 06:05 PM
  2. sound problem
    By iceman1 in forum Multimedia Hardware
    Replies: 1
    Last Post: October 5th, 2003, 03:44 PM
  3. disable a sound
    By INE-Kpro... in forum Flash Help
    Replies: 5
    Last Post: September 10th, 2003, 10:44 AM
  4. 2k3 drivers, boy i wish i had sound...
    By unatratnag in forum Windows Help
    Replies: 4
    Last Post: August 28th, 2003, 09:17 PM
  5. Replies: 1
    Last Post: June 13th, 2002, 02:29 AM

IMN logo majestic logo threadwatch logo seochat tools logo