Solved

explode on new line

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

15 Experts available now in Live!

Get 1:1 Help Now