<?php // Example 1 $testValues = "test1 test2 test3 test4 test5"; $testArray = explode(" ", $testValues); print_r($testArray); //Array ( [0] => test1 [1] => test2 [2] => test3 [3] => test4 [4] => test5 ) // Example 2 $testValues = "test1,test2,test3,test4,test5"; $testArray = explode(",", $testValues); print_r($testArray); //Array ( [0] => test1 [1] => test2 [2] => test3 [3] => test4 [4] => test5 ) ?>