| 
	
 | 
 Posted by Daniel Gross on 01/01/06 20:37 
Hello 
 
I am trying to access the constant name as string and not the constant  
contents. For example, 
 
define('myconst', 'const text 1'); 
 
$myArray = array() 
 
myArray['myconst'] = "this is it" 
etc. 
 
$xmltext=""; 
foreach ($myArray as $key => $val) { 
    echo "$key = $val\n\n"; 
    $xmltext .= "$xmltext = $xmltext . "<$key> $val </$key>"; 
} 
 
Unfortunately, $key within the string concatenation is translated into  
the constant value. However, for the echo statement, then $key constant  
name is displayed. Is there a way to keep the constant name rather its  
value when manipulating it as a string? 
 
thanks, 
 
Daniel
 
[Back to original message] 
 |