Removed Areas > PHP
<Script> tag for PHP?
(1/1)
jeremejazz:
Hi, someone told me that the
--- Code: PHP ---<script> tag can also be used for calling php functions... is that true?
mwb1100:
you should be able to use:
--- ---<script language="php"> ... </script>
See Example #2 on http://www.php.net/manual/en/language.basic-syntax.phpmode.php
Deozaan:
If you just want to do a short section of PHP, why wouldn't you use the normal PHP tags? It's been a long time since I've done any PHP, but isn't it something simple like <?php>?
Stoic Joker:
you should be able to use:
--- ---<script language="php"> ... </script>
See Example #2 on http://www.php.net/manual/en/language.basic-syntax.phpmode.php
-mwb1100 (October 18, 2010, 12:03 PM)
--- End quote ---
The moral of the story (at the link you posted) seems to be yes you can do it, but it's a bad habbit/idea that will bite you in the ass down the road. <?PHP ...code... ?> or <?=$Value?> are both universally safe in any environment/version or mixture of code.
Not to mention it looks too much like a Java Script tag of your skimming something large in a hurry (We've all done that at least once...).
Navigation
[0] Message Index
Go to full version