Author Topic: Demolitions  (Read 263 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 139
  • Karma: 0
    • No Addiction
« on: 07-19-2016, 05:49:32 »
Assuming the piece of text we’ve been using contains line feed characters, we could use the explode function to break it up into an array of lines:

$text = <<<EOD
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is awidely-used Open Source general-purpose scripting language that
is especially suited for Web development and can be embedded
into HTML.
$lines = explode("\n", $text);
echo "<table border=\"1\">\n";
foreach ($lines as $line) {
echo "<tr>\n<td>$line</td>\n</tr>\n";
echo "</table>\n";