note 48627 added to function.get-defined-constants

From: Date: Sun, 02 Jan 2005 17:39:31 +0000
Subject: note 48627 added to function.get-defined-constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-82604@lists.php.net to get a copy of this message
This function is very usefull if you want to expand constant values in a string especially when using heredoc syntax. It's easy like that <?php define ('cNAME', 'Peter'); define ('cPLACE', 'Sydney'); $constants = get_defined_constants(); $text = <<< EOT Hi {$constants['cNAME']} have you ever been in {$constants['cPLACE']}? EOT; echo $text; ?> ---- Manual Page -- http://www.php.net/manual/en/function.get-defined-constants.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48627 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48627&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48627&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82604) next »