0
   

PHP CONSTANTS

 
 
Reply Sat 23 Apr, 2016 07:39 am
I have to define named constants for the following error messages and list their names and values in a table.
File not found
File cannot be read
File cannot be written
File cannot be deleted
File cannot be renamed

below is my code; but I don`t know if I have written it correctly!
<!DOCTYPE html>
<title>Practical8</title>
<html>
<body>
<?php
define("NOFILE", "File not found");
define("NOTREAD", "File cannot be read");
define("NOTWRITTEN", "File cannot be written");
define("NOTDELETED", "File cannot be deleted");
define("NOTRENAMED", "File cannot be renamed");
$str = <<<TAB
<table border="1" style="width:100%">
<tr>
<td>{"NOFILE"}</td>
<td>{"NOTREAD"}</td>
<td>{"NOTWRITTEN"}</td>
<td>{"NOTDELETED"}</td>
<td>{"NOTRENAMED"}</td>
</tr>
<tr>
<td>{"File not found"}</td>
<td>{"File cannot be read"}</td>
<td>{"File cannot be written"}</td>
<td>{"File cannot be deleted"}</td>
<td>{"File cannot be renamed"}</td>
</tr>
</table>
TAB;
echo $str;
?>
</body>
</html>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 738 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » PHP CONSTANTS
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/19/2024 at 01:49:51