[PHP] Re: hard(?) syntax problem

2003-11-04 Thread pete M
unfortunately Constants are scalar only, arrays not allowed

below is from the manual
---
Constants do not have a dollar sign ($) before them;

Constants may only be defined using the define() function, not by simple 
assignment;

Constants may be defined and accessed anywhere without regard to 
variable scoping rules;

Constants may not be redefined or undefined once they have been set; and

Constants may only evaluate to scalar values.

pete

Adam I Agnieszka Gasiorowski Fnord wrote:

	I want to access a value of an array
 by key, but the array is not a variable
 - it is a constant. 

	How do I do it?

	I tried 

	$value = PL_ORT[$key];

	, but this doesn't work (parse error)...

	I even tried 

	$value = {PL_ORT[$key]};

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: hard(?) syntax problem

2003-11-04 Thread DvDmanDT
You could try
$tmp=constant(PL_ORT);
$value=$tmp[$key];

But I doubt it'll work..

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
##
Please, if you are using windows, you may be infected by Swen. Please go
here to find out more:
http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen
http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED]
##
Adam I Agnieszka Gasiorowski Fnord [EMAIL PROTECTED] skrev i
meddelandet news:[EMAIL PROTECTED]

 I want to access a value of an array
  by key, but the array is not a variable
  - it is a constant.

 How do I do it?

 I tried

 $value = PL_ORT[$key];

 , but this doesn't work (parse error)...

 I even tried

 $value = {PL_ORT[$key]};

 -- 
 Seks, seksiæ, seksolatki... news:pl.soc.seks.moderowana
 http://hyperreal.info  { iWanToDie }   WiNoNa)   (
 http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
 Poznaj jej zwiewne kszta³ty... http://www.opera.com 007

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php