Seporating String contents

Discussion in 'PHP' started by ::Mike::, Oct 25, 2008.

  1. #1
    So if I pull a string up like "string1-string2.php"

    I used the - to seporate the string.
    But I dont understand how to use preg_match (if thats what i need), but I want to pull out string1 and string2 into a array.
     
    ::Mike::, Oct 25, 2008 IP
  2. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $strings = explode("-","whatever-whatever");
     
    Kyosys, Oct 25, 2008 IP
    ::Mike:: likes this.
  3. ::Mike::

    ::Mike:: Peon

    Messages:
    826
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ah yes explode I'm such a idiot :D.

    Thanks!
     
    ::Mike::, Oct 25, 2008 IP
  4. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    no problem
     
    Kyosys, Oct 25, 2008 IP