Difference between revisions of "PHP 5"

From Ilianko
Line 9: Line 9:
 
<body>
 
<body>
 
&lt;table border=1>
 
&lt;table border=1>
&lt;tr></tr>
+
&lt;tr>
 
&lt;td>Вид</td>
 
&lt;td>Вид</td>
 
&lt;td>Цена</td>
 
&lt;td>Цена</td>
 
&lt;td>Количество</td>
 
&lt;td>Количество</td>
+
</tr>
 
&lt;tr>
 
&lt;tr>
 
 
Line 31: Line 31:
  
 
</pre></code>
 
</pre></code>
 +
 +
== include ==
 +
 +
include()
 +
include_once()
 +
require()
 +
require_once();
 +
 +
<?php
 +
include("header.php");
 +
include("menu.php");
 +
?>
 +
 +
 +
&lt;table border=1>
 +
&lt;tr>
 +
&lt;td>Вид</td>
 +
&lt;td>Цена</td>
 +
&lt;td>Количество</td>
 +
</tr>
 +
 +
<?php
 +
 +
foreach($_SESSION['buy'] as $value)
 +
{
 +
echo '<tr>
 +
<td>'.$value['vid'].'</td>
 +
    <td>'.$value['price'].'</td>
 +
    <td>'.$value['quantity'].'</td>
 +
</tr>';
 +
}
 +
?>
 +
 +
</table>
 +
 +
<?php
 +
 +
include("footer.php");
 +
?>
 +
 +
 +
 +
 +
== ==
 +
  
 
*trim();
 
*trim();

Revision as of 10:58, 23 October 2013


<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8"  />
  </head>
<body>
<table border=1>
	<tr>
	<td>Вид</td>
	<td>Цена</td>
	<td>Количество</td>
	</tr>
	<tr>
		
		<td>Картофи</td>
	<td>0.99</td>
	<td>10 кг.</td>
		
		
	</tr>	
	
	
</table>

</body>

</html>

include

include() include_once() require() require_once();

<?php include("header.php"); include("menu.php"); ?>


<table border=1> <tr>

<td>Вид <td>Цена <td>Количество <?php foreach($_SESSION['buy'] as $value) { echo ' '.$value['vid'].' '.$value['price'].' '.$value['quantity'].' '; } ?>

<?php

include("footer.php");

?>



  • trim();
  • strip_tags();
  • is_numeric($var);
  • mb_strlen();
  • mb_internal_encoding();