explode comma content

General discussions related to php

Moderators: egami, macek, 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

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
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 1 guest