Powered by InterCreatives | Site Map
Search:
NewSourceMedia Popular Tutorials: PHP Javascripts Web Hosting
SoftwareTutorials
CATEGORIES
Job Listings
 
Home / PHP / Debugging and Testing

Split() by newline and return using PHP

Published by: Alex


Introduction:

I was having a problem trying to split a string of multiple lines from an online form using the flowing code:

<?php
   $arry_names = split("n", $names);
?>


This was producing an unexpected line break. I searched the web to see if anyone had the same problem and found that I needed to check for "returns" (r) also. So now when I'm splitting data by lines, I use the following code:

<?php
   $arry_names = split("[n|r]", $names);
?>


Next PHP Page:
1  2  3  4  5  6  7  8  9  10  11  [12]  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32 





Hosting by iPowerWeb.com - 50 Gb for $7.95