Skip to content
Advertisement

How to separate strings from csv file using php?

How can I separate the strings from csv file by using "," or "rn"?

Advertisement

Answer

Use explode to separate string

<?php
    $csv_string = file_get_contents("file.csv");
    $separated = explode("n", $csv_string);
    print_r($separated);
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement