Solved

explode on new line

Posted on 2008-10-28
2
280 Views
Last Modified: 2012-05-05
This does not work:
      $lines = explode(array("\n","\r","\r\n"), $page);

How can I expload my string into an array from an array of ALL newline codes?
0
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 16

Expert Comment

by:sh0e
ID: 22825244
$line = split("[\r][\n]|[\r\n]", $page);
0
 
LVL 16

Accepted Solution

by:
sh0e earned 500 total points
ID: 22825257
$lines = split("[\r\n]+", $page);
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question