1

I created 3 text files and I want to create a bullet form list with hyperlinks that will direct the user to each file created. How can I code this?

echo "<ul>";
echo "<li>" . <a fopen("test.txt", "r") or die("Unable to open file!");>Test 1</a>  "</li>";
echo "<li>"  . $filename = 'test2.txt' . "</li>";
echo "/<ul>";
Dharman
  • 30,962
  • 25
  • 85
  • 135
yermteam
  • 35
  • 4

1 Answers1

1

Please note that /<ul> is not the correct closing tag, it should be </ul>

On the other hand, you may use the Nowdoc string quoting syntax (or similar):

<?php
echo <<<'EOD'

<ul>
<li><a href='test.txt'>Test1</a></li>
<li><a href='test2.txt'>Test2</a></li>
</ul>

EOD;

?>

For further reference on the above , please view the official documentation:

http://docs.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc

Ken Lee
  • 6,985
  • 3
  • 10
  • 29