Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with strings! 1

Status
Not open for further replies.

juuso79

Programmer
Nov 15, 2001
22
FI
This is my problem.

I have this text file. Text is divided into parts with ";" -marks like this:

Here is some text;Here is Some text more;And again;And again...;

I want to know how can I take that text and chop it automaticly into variables like this:

$variable[0] = "Here is some text";
$variable[1] = "Here is Some text more";
$variable[2] = "And again";

Thanks in advance!
 
Use the split() function like so:

Code:
$variable = array()
$text_line = "Here is some text;Here is some text;Here is some text";
$variable = split (";", $text_line);

Hope this helps.
-Vic
vic cherubini
krs-one@cnunited.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top