Hello. I need to export the text typed into the text area and import it into an arraw.
but when i type in new lines it cant't read it.
example:when user types:
aaa
bbb
ccc
bbb
the out put at the end should be:
aaa
bbb
ccc
this is the code i tryed to do this, but it wont work.
$string_typed=$_GET['name']; //name is the id of text area
$replaced=str_replace("\n\r","\n",$string_typed); //i want to replace new lines
$exploded_string = explode("\n\r", $replaced); // the replaced string to insert into the array.
$print_string=array_unique($exploded_string ); // to remove the dublicated lines
foreach($aprint_string as $w){ //printig each of them.
echo $w ."<br>";
}
// any ideo how can i realize it ?