Solved

explode on new line

Posted on 2008-10-28
2
275 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
Comment Utility
$line = split("[\r][\n]|[\r\n]", $page);
0
 
LVL 16

Accepted Solution

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 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