0

The explode function breaks the data in $kkkk into fragments and stores them into array whenever - is encountered. Now the problem is i want to explode the same data, whenever Enter key was used. Please help me,i got stuck for whole day.

<?php
// TO BREAK THE DATA INTO SMALL PARTS
$ooo = explode("-", $kkkk);
for($i=0;$i<count($ooo);$i++)
{
// TO READ THE FILE EXTENTION FROM EACH PART
$ext = pathinfo($ooo[$i], PATHINFO_EXTENSION);
// TO CHANGE THE CODE DEPENDING ON FILE EXTENTION
if($ext=='jpg'||$ext=='jpeg'||$ext=='png'||$ext=='gif'||$ext=='bmp')
{ $ooo[$i]="<img src=\"$ooo[$i]\"><br>"; }

}

// TO COMBINE BROKEN DATA INTO ONE
for($i=0;$i<count($ooo);$i++)
{
$ggg=implode("", $ooo);
}
?>
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sakush100
0
explode( "\r\n", $data );

in "Windows OS" or

explode( "\n", $data );

in *unix

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.