Say I have this array for example:
print_r($array);
Prints:
Code: [Select]Array
(
[0] => Array
(
[status] => 0
)
[1] => Array
(
[status] => 1
)
[1] => Array
(
[status] => 0
)
)
Now I have another array:
$color_array = array('0'=>'nocolor','1'=>'green');
How I can do the logic of this?
foreach($array as $tmp){
// Say status holds "1" in this case so it translate to
//$color_array[1]; = green
echo "{$color_array[$tmp['status']]}";
}
Obviously the above generate Illegal offset type. So I cant do that.
Dynamic links in an include file
I am working on a small piece of code that counts records from a database and displays the result to the user. Everything works fine, except I am running into difficulties with dynamic links.The code
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have something like this
mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts??? this is the code i got from a tutorial :Code: [Select]<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase
Parse String
I need to parse the string below into three variables. How would I do that?john + 10/20/2008 - 10/30/2008+ and - are separators
Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place that it is hosted just did some upgrades to their servers and for some reason, now my login page
Not capturing all the information we require in the form.......
Hi Guys,I was wondering if you would share some more of your knowledge today, I'm hoping it will be quite a simple answer for you but one that is boggling us here! ;-)We have an html form that users
unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.
Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyone can veiw them pages. Is there any way in which i can stop them veiwing the page without
Need Reporting Advice
My SQL server doesn't support MS SQL reporting services that comes with SQL Enterprise or Express. Then the administrator suggested that I google for alternatives. I'm a newbie and don't even know
AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called through onClick="function ..." on the submit button. That all works perfectly, however the