Jump to content

Help with Array Please


kphpm

Recommended Posts

Hello Again.

 

Sorry i have to ask for help again.

 

Due to the Help in my other topic i managed a lot while working on my webinterface.

 

However now i have a issue again :(

 

ok here is the array

Array
(
    [0] => Array
        (
            [status] => 3
            [ip] => 178.21.114.239
            [maxsnapshot] => 5
            [hostname] => 
            [password] => 0
            [iso] => 14
            [tag] => 
            [imageid] => 0
            [traffic] => 500
            [paymenttypeid] => 0
            [ipv6] => 2a02:2308::216:3eff:fe91:1d1e
            [kernelid] => 0
            [bootorder] => 2
            [memory] => 1024
            [locationid] => 1
            [hwid] => 24
            [monitoring] => 0
            [vpsid] => 1201
            [sshkey] => 
            [product] => 
            [type] => 1
            [productid] => 32
        )

    [1] => Array
        (
            [status] => 3
            [ip] => 178.21.117.207
            [maxsnapshot] => 5
            [hostname] => 
            [password] => 0
            [iso] => 61
            [tag] => 
            [imageid] => 0
            [traffic] => 4000
            [paymenttypeid] => 0
            [ipv6] => 2a02:2308::216:3eff:fe0a:c826
            [kernelid] => 0
            [bootorder] => 0
            [memory] => 8192
            [locationid] => 1
            [hwid] => 195
            [monitoring] => 0
            [vpsid] => 1663
            [sshkey] => 
            [product] =>
            [type] => 1
            [productid] => 36
        )

    [2] => Array
        (
            [status] => 3
            [ip] => 141.105.120.61
            [maxsnapshot] => 5
            [hostname] => kevin
            [password] => 1
            [iso] => 0
            [tag] => Testserver
            [imageid] => 36
            [traffic] => 250
            [paymenttypeid] => 0
            [ipv6] => 2a02:2308::216:3eff:fe22:3f49
            [kernelid] => 27
            [bootorder] => 0
            [memory] => 512
            [locationid] => 1
            [hwid] => 52
            [monitoring] => 0
            [vpsid] => 1967
            [sshkey] => 
            [product] =>
            [type] => 2
            [productid] => 31
        )

)

Now i want to Display the results for example only for the vpsid 1967 , i know i can echo all results with a nested foreach loop but how to look for something inside the array in this case array 2 and display the rest of it?

Link to comment
https://forums.phpfreaks.com/topic/290573-help-with-array-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.