Search found 4 matches
- Sat Jul 23, 2011 8:55 am
- Forum: PHP
- Topic: Can a value in an array have a label that isnt its value?
- Replies: 5
- Views: 902
Re: Can a value in an array have a label that isnt its value
Morning... Im not sure why I didnt realise this at first... just re-read your reply about using an extra element and Ive sorted it now. I just added a 3rd value which was the URL ([2]) and left the $online variable to use elements [0] & [1] but then used [2] & [1] for the actual table values...
- Fri Jul 22, 2011 6:09 pm
- Forum: PHP
- Topic: Can a value in an array have a label that isnt its value?
- Replies: 5
- Views: 902
Re: Can a value in an array have a label that isnt its value
Also, not sure if you would want to see this bit aswell from the status.php : <tbody> <?php foreach ($servers as $server){ $online = server_online($server[0], $server[1]); ?> <tr> <td><?php echo $server[0], ':', $server[1]; ?></td> <td class="<?php echo ($online) ? 'online' : 'offline'; ?>"...
- Fri Jul 22, 2011 6:07 pm
- Forum: PHP
- Topic: Can a value in an array have a label that isnt its value?
- Replies: 5
- Views: 902
Re: Can a value in an array have a label that isnt its value
Hiya, thanks for the reply so soon. Here is my init.inc.php : <?php $servers = array( array('collinsworld.ath.cx', '25565'), array('172.16.0.79', '25565'), ); error_reporting(0); //$path = dirname(___FILE___); include('minecraft_server.inc.php'); ?> I basically want the 2nd array to use 172.16.0.79 ...
- Fri Jul 22, 2011 4:40 pm
- Forum: PHP
- Topic: Can a value in an array have a label that isnt its value?
- Replies: 5
- Views: 902
Can a value in an array have a label that isnt its value?
Hi, I have just followed the Minecraft Server Status tutorial and it is all working as expected, (great videos - I have never used php before and yet I have managed to just about fudge through this afternoon with lots of rewinding/replaying of the video) however Ive now got a tiny little problem I h...