explode comma content

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 86
Joined: Mon Jun 04, 2012 10:05 pm
Location: Ankara, Turkey

Re: explode comma content

Post by ejsexton82 » Tue Jun 12, 2012 2:09 am

Well, if all you want to do is change the "spaces" to "newlines", then this is the easiest solution:

Code: Select all

echo nl2br($data);
If you want to parse the data, then something like this should work:

Code: Select all

$array = array();
$rows = explode("\n",$data);
foreach($rows as $index => $row) {
	$cols = explode(',',$row);
	$array[] = $cols;

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests