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.
Any meaningful project for a new C++ programmer?
I want to do some meaningful program, so I can help myself to learn
why does my session end?
my connect.php starts the session just so you knowi can navigate arround my site fine except when i come to this page. it lets me in but then when i try to leave no matter what page i go to or which
How to refresh a parent page from a modal popup
Hi,I have a modal popup in which I need to upload a file and store in the database should give a message to the user that file is uploaded and update the parent page when I close the
private constructor
Hello,Can we create a constructor as private? If yes, what is the use of it? If no, why can't we make it?Please suggest...Thanks
Update Database
Hi All,I have a problem with this:Code: [Select]<?phpsession_start();include('../common/dbconnect.php');$stock_id = $_GET['stock_id'];$query='SELECT * FROM users_stocks WHERE user_id ="' .
IDOC error
Hi,
Local file browser with php
Halo..So this is what i want to create. I have a folder that i share and it has many movies..So i will setup a local web browser and i want to make a .php file that after you login it will saw you the
Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email confirmation process.Here is my code :Line number On/Off | Expand/Contract <?php//sessions
Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y int 3' in an easy way with maybe a for loop or something?I want the data entered to be like this:0x
Estimations and Effort
HI Gurus,