MySQL Forums
Forum List  »  PHP

Re: Simple script to split data in a column by semicolon
Posted by: Peter Brawley
Date: May 04, 2006 12:29PM

Simplest way to get the semicolon-separated strings would be ...

$a = explode( ";", $row );

where $row is the fetched table row and $i is index of the column containing the desired string.

To "put each one on a newline" ...

foreach( $a as $s ) printf( "%s\n", $s );

I do not understand "copy the adjacent column data in the table along with each newline."

PB



Edited 1 time(s). Last edit at 05/04/2006 12:37PM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
Re: Simple script to split data in a column by semicolon
May 04, 2006 12:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.