<?php $testString = "FirstName,MiddleName,LastName"; $testArray = split(",",$testString); print_r($testArray); //Array ( [0] => FirstName [1] => MiddleName [2] => LastName ) ?> <?php $testString = "FirstName MiddleName,LastName"; list($first, $middle, $last) = split('[ ,]', $testString); echo "First Name: $first; MiddleName: $middle; LastName: $last"; ?>