php將字串分隔為陣列- explode

  1. $string  = "aa,bb,cc,dd";   
  2.   
  3. $output = explode(" "$string);   
  4.   
  5. echo $output[0];      // aa   
  6. echo $output[1];      // bb   
  7. echo $output[2];      // cc   
  8. echo $output[3];      // dd  

留言