FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Why Can't I "define" a Value for a Subscript?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Why Can't I "define" a Value for a Subscript? [message #175237 is a reply to message #175235] Sun, 28 August 2011 19:43 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sun, 28 Aug 2011 15:18:32 -0400, eBob.com wrote:

> whereas this produces what I expected ...
> echo "we have a match - key: $file2cols[0]\n";
> ... this does not ...
> echo "we have a match - key: $file2cols[SS2KEY]\n";

Try:

echo "we have a match - key: {$file2cols[SS2KEY]}\n";

This php:

<?php
define('ZERO',0);
define('SZERO','zero');
$bloop = array();
$bloop[ZERO] = 0;
$bloop[SZERO] = 'nought';
echo "{$bloop[ZERO]},{$bloop[SZERO]}\n";
?>

Gives this output:

$ php constants.php
0,nought
$

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Deploying PHP 5.3 on CentOS 5.6 with Puppet
Next Topic: Strategic Marketing Summit 2011 (September 24th,Chennai)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 12:50:23 GMT 2024

Total time taken to generate the page: 0.04969 seconds