0

I installed a new WAMP on my computer (before I used XAMPP - everything was good as I remember). My problem is the php output tag (<?= ?>) which is not working (in the browser when I click on show sourcecode it is appears exactly in the file - so it is not processed...)

Am I wrong something? Is there an option in php.ini to turn on this tag? I need this tag.

Code how I tried:

<?php
 $examples = "Some text...";
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Examples</title>
    </head>
    <body>
        <h1>Examples</h1>
        <ul>
            <?= $examples ?>
        </ul>
    </body>
</html>

2 Answers 2

10

You can turn it on updating the php.ini to allow short tags. Mouseover the PHP menu option in WAMP and look for settings. Set short_open_tag to on.

Sign up to request clarification or add additional context in comments.

2 Comments

As an aside, starting with PHP 5.4 <?= ?> syntax is available regardless of short_open_tag being on or off.
Thanks for the exact setting name. I was doing this from memory and couldn't remember the exact setting name.
0

You can update your php.ini. But i think it's better to use the classic tags to avoid problem with xml tag

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.