SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sting variable help

    Hi, I need to be able to remove the first character in a string like:
    &one&two&three&four&five&six
    but i need it to be like:
    one&two&three&four&five&six

    Can someone please help me?

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty please?

  3. #3
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi !
    u can use substr command , here is some ex. :
    PHP Code:
    $rest substr ("abcdef"1);    // returns "bcdef"
    $rest substr ("abcdef"13); // returns "bcd"

    // Or 
    $rest substr ("abcdef", -1);    // returns "f"
    $rest substr ("abcdef", -2);    // returns "ef"
    $rest substr ("abcdef", -31); // returns "d" 
    hope this help u

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, thank you, thank you!

  5. #5
    SitePoint Zealot alexk's Avatar
    Join Date
    Nov 2000
    Location
    Sydney, Australia
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's correct... for your example it will look like:
    PHP Code:
    $str substr($str1strlen($str)-1); 

  6. #6
    SitePoint Zealot alexk's Avatar
    Join Date
    Nov 2000
    Location
    Sydney, Australia
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or just...
    PHP Code:
    $str substr($str1); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •