RE: Echo a value from an arrays position

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Lasso can do the following, can PHP?

<?LassoScript

Variable:
'Colors'=(Map:'red'='#ff0000','green'='#00ff00','blue'='#0000ff');

Loop: $Colors->Size;

    Output: '<br>' + $Colors->(Get: Loop_Count),-EncodeNone;

/Loop;

?>

This outputs;

    ff0000
    00ff00
    0000ff

I'm new at PHP but not Lasso that's why I'm for you asking odd
questions.
[/snip]

1. Always respond to the list as a single user may not be there to
answer your question or your individual e-mail may get dumped to the
spam list. I just happened to be cleaning my spam folder when your
message popped up.

B. Reading backwards is a pain.
Why?
Please do no top post.

Less code than Lasso;

$colors =
array('white'=>'#ffffff','black'=>'#000000','blue'=>'#0000ff');
foreach($colors AS $key => $value){
	echo $value . "<br />\n";
}

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux