In testing the array values in TEST1.PHP, I want to differentiate between blank lines and nulls. Any ideas?
I have tried testing for " ", "\n", " \r\n" etc
Clive
I have tried testing for " ", "\n", " \r\n" etc
Code:
TEST1.HTM
<html><body>
<form name="mail" method="post" enctype="multipart/form-data"
action="[URL unfurl="true"]http://chemtechs.com/kiss/test1.php">[/URL]
Message:<br />
<textarea name="t" rows="6" cols="36">
line-1
line-2
line-4
</textarea><br />
<input value="Send" type="submit" />
</form></body></html>
Code:
TEST1.PHP
<?php
$text=$_POST['t'];
$line = explode("\n", $text);
for ($i=0; $i<9; $i++) {
echo ($line[$i]);
if ($line[$i]=="") {echo('null-line');}
if ($line[$i]=="\r\n") {echo('blank-line');}
echo ('<br />');
}
?>
Clive