tags:

views:

38

answers:

2

I knew there are two ways to represent PHP code start/end.

<?php ?>

and

<? ?>

In this code snippet:

<?php
for($x=5;$x<25;$x=$x+5):
$List .= '<option value="'.$x.'">Greater than '.$x.'% increase</option>';
endfor;
?>

<html>
...
<select name="growth" id="growth">
<option value="">Choose one</option>

<?=$List ?>
</select>

...
</html>

What is the meaning of the <?=$List ?>?

+2  A: 
<?php echo $List ?>

The shorttag syntax is deprecated though.

David Dorward
+3  A: 

<? is the shorthand version of the opening tag, <?php. The = means to echo the specified string/variable, so the whole thing is shorthand for:

<?php
echo $List
?>
Michael Mrozek