[SOLVED] An array question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

[SOLVED] An array question

Post by John Cartwright »

How would I give all the variables in this array

$de_dust2 = array('$de_dust2_a', '$de_dust2_b', '$de_dust2_c', '$de_dust2_d');

a value of 0??

TY
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Code: Select all

<?php
foreach($de_dust2 as $key => $value)
  $de_dust2[$key]=0;
?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

yay ty
Post Reply