splitting strings into two words

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • soundharya
    New Member
    • Nov 2012
    • 1

    splitting strings into two words

    If the input is hello,"sri,ram"
    the output should be hello
    sri ram.how to solve it?
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Code:
    $pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
    $pieces = explode(" ", $pizza);
    echo $pieces[0]; // piece1
    echo $pieces[1]; // piece2
    (source: php.net )

    Comment

    Working...