-1

Possible Duplicate:
What does '<?=' mean in PHP?

I'm reading someone else's code and I don't think I've come across this before.

if((< ? =date("Y");?>-parseInt($('#year').find('option:selected').val()))<18) 

Any thoughts?

Thanks

Community
  • 1
  • 1
  • 3
    It's worth noting that the snippet of code you've posted is javascript with embedded PHP. – John Carter Nov 22 '11 at 21:16
  • *(related)* [What does that symbol mean in PHP](http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php) – Gordon Nov 22 '11 at 21:20

4 Answers4

4

<?= is the short open and echo tag. Here is the PHP documentation for it.

WWW
  • 9,734
  • 1
  • 29
  • 33
1

<?= is short-hand for <?php echo, but only works if php.ini is setup properly.

Brian Driscoll
  • 19,373
  • 3
  • 46
  • 65
0

Same as <?php echo ...

It is not always enabled in some environments.

djdy
  • 6,779
  • 6
  • 38
  • 62
0

That evaluates to:

if((<?php echo date("Y"); ?>-parseInt($('#year').find('option:selected').val()))<18)

But I think its recommended for you to use <?php echo '';?> instead of <?= ?> for compatibility reasons.

Jose Vega
  • 10,128
  • 7
  • 40
  • 57