Using the explode() Function : explode « Data Structure « PHP
- PHP
- Data Structure
- explode
Using the explode() Function
<?php
$input_string = "this is a test.";
$pieces = explode(",", $input_string);
echo "Names in List: <BR/>\n";
foreach($pieces as $name) {
echo trim($name) . "<BR/>\n";
}
?>
Related examples in the same category