SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: PHP and cutting

  1. #1
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you cut up variables. For example how do I extract the 169 out of this: #5934 Shopping Tote - $169

    Thanks.

    ------------------
    Nate - nate@jumpthru.com
    ICQ 70944023
    http://www.jumpthru.com - Unbelievable Website design!
    http://www.jumpthru.com/christian - Learn, live, love, jesus christ...

  2. #2
    SitePoint Zealot
    Join Date
    Nov 1999
    Location
    Manhattan!
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $string = "#5934 Shopping Tote - $169";
    $string = explode("$",$string);
    $number = $string[1];

    // $number now contains 169


    Christian

  3. #3
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.

    ------------------
    Nate - nate@jumpthru.com
    ICQ 70944023
    http://www.jumpthru.com - Unbelievable Website design!
    http://www.jumpthru.com/christian - Learn, live, love, jesus christ...


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
  •