Skip to main content
Home / Code Snippets / PHP / Convert Comma Separated String into Array

Convert Comma Separated String into Array

Easy way to turn a CSV file into a parseable array.

<?php
$str="foo,bar,baz,bat";
$arr=explode(",",$str);
// print_r($arr);
?>
icon-link icon-logo-star icon-search icon-star