2 Replies - 316 Views - Last Post: 13 August 2011 - 10:37 PM Rate Topic: -----

#1 legithugo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 21-July 11

Array listing Using API

Posted 13 August 2011 - 07:03 PM

Hey, I'm currently working on a project but I can't quite get my array to display correctly, here is what my array is:

$myarray = Array ( [report] => Array ( [0] => 2011-08-13 02:25:03 [1] => Array ( [nProtect] => [CAT-QuickHeal] => [McAfee] => Generic VB.i ........


And Im wanting to be able to say something like this:
echo $myarray[0]; //And the output is "2011-08-13 02:25:03"
echo $myarray[nProtect]; //And the output is "nProtect : "
echo $myarray[McAfee]; //and the Output is "McAfee : Generic VB.i"


Etc....

Anyway, so How do I echo the certain part of the array?... Been trying tons of stuff not really working out, any help would be greatly appreciated, thanks :D

Is This A Good Question/Topic? 0
  • +

Replies To: Array listing Using API

#2 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: Array listing Using API

Posted 13 August 2011 - 09:15 PM

A certain part as in slicing the array? => array_slice.
You need to be a bit more specific as to what you're trying to do.
Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10488
  • View blog
  • Posts: 38,868
  • Joined: 27-December 08

Re: Array listing Using API

Posted 13 August 2011 - 10:37 PM

It looks like you're trying to cram a lot of information into the array. You may consider using Object Oriented Programming to better organize the information.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1