Solved

explode on new line

Posted on 2008-10-28
2
276 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Should I use subdomains or addon domains? 3 37
Why my select dropdown does not work? 8 27
php construct 5 13
PHP populating an array. 4 0
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now