Pioneer Skin
Login  ::  Register
Thursday, February 09, 2012
 
- - - - - - - - Sponsorship Advertisement Area - - - - Thank you to our Sponsors - - - - - - - - -
New Horizons Computer Learning Centers
WGD Discussion Forum
SearchForum Home
     
  Web Design  Programming  pushing values ...
 pushing values to a multidimensional array in php
 
 4/5/2007 7:36:01 PM
therustycook
15 posts


pushing values to a multidimensional array in php

I am working on a website with a fair amount of php.  I am doing queries to an LDAP directory.  I need to populate a multidimensional array with information.  I am pulling a field from each of 4 servers and need to put it into a table with the server name then the particular value I queried from the server.  I have not been able to find out how to write the variables to the array.  I just need to pop them on the end of the array.

 

 4/19/2007 3:18:10 PM
anonymous
0 posts


Re: pushing values to a multidimensional array in php
here is something that might help. This is was for images - but im sure you can take the same thing and populate it with the information you need:
<?php
    if (count($images) > 0) {
        $imgcount = 0;
   
        $firstImage = '';
        $transDetails = '';
        $captionDetails = '';
        $imageArray = array();   
        $captionArray = array();
   
        foreach($images as $img) {
            if ($imgcount++ == 0) {
                if ($imageStart)
                    $firstImage = $imagePath . $imageStart;
                else
                    $firstImage = $imagePath . $img;
            }
            $imageArray[] = "'$img'";
            if ($showCaption) $captionArray[] = "'" . getInfo($imagePath, $img) . "'";
        }
   
" .  implode(",", $imageArray) . " ?>
  Web Design  Programming  pushing values ...
Copyright 2007-2008 by WGD Forum :: Designed by ZapWebDesign.com