René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Arrays in PHP

A php page containing this code....
<html><head><title>Textarea example with PHP</title></head>

<?php $ta=htmlspecialchars($_POST['ta']); ?>

<body>

  <form method='post'>

    <textarea rows=10 cols=80 name='ta'><?php print $ta; ?></textarea>

    <p>
    <input type='submit' value='go'>

  </form>

  <?php

    $lines = preg_split('/\n/', $ta);

    print sizeof($lines) . " line(s) were submitted<p>";

    print "Those are: ";
    foreach ($lines as $line_no => $line) {
      print "<br>$line_no: $line";
    }

  ?>

</body>
</html>
... can be found here.