<html>
<head>
<title>Mini & Fast Template</title>
</head>
<body>
<pre>
<B>Example 1. Simple variables assign:</B>
Inteter:<?php var_dump($int_var);?>
String:<?php var_dump($string_var);?>
Boolean: <?php var_dump($boolean_var);?>
<u>You assinged an interger </u>value with values = <?=$int_var?>, and a string value is <?=$string_var?>
<B>Example 2. If else condition..</B>
<? if(isset($show_category)){?>
This is if case: You set to show the category
<? }else{ ?>
This is else case: You have no right to see category.
<? } ?>
<B>Example 3. Working with Loop, php array assign </B>
Structure of fruits: <?php print_r($fruits)?>
Try to loop and print out fruits:
<?php $i=1;?>
<?php foreach($fruits as $fruit):?>
<?=$i++?>.
TYPE = <?=$fruit['type']?>
NAME = <?=$fruit['name']?>
COLOR = <?=$fruit['color']?>
PRICE = <?=$fruit['price']?>
<?php endforeach?>
<B>Example 4: assign a class (calling method __toString())</B>
Person is: <?=$person?>
<HR>
--- Thanks ---
</body>
</html>
|