FOLLOW US
4dots Software CODE BLOG

How to Use PHP Variables inside HTML Tags without Echo

To use php variables inside HTML tags, without using an echo command, you can use the shorthand-type <?= ?>


For example :


$PAGEURL='http://www.4dots-software.com';

<a href="https://www.facebook.com/sharer/sharer.php?u=<?=$PAGEURL ?>">

will output :


<a href="https://www.facebook.com/sharer/sharer.php?u=http://www.4dots-software.com">

 

Please Donate!

Please Share!