PHP Constants

<?php define("GREETING", "Welcome to W3Schools.com!"); echo GREETING; ?>

1 Response

Note: Constants cannot be modified from their original definition throughout the code, however you can use sprintf() or preg_replace into output of another variable which is useful for SQL and GETTEXT functions.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.