Jump to content

Search the Community

Showing results for tags 'array Php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. how to populate PHP multidimensional array and add the attributes to the category heading nodes, I have the following Books array $book = array( "language"=> array("English","Franch","Arabic"), "Programming"=> array("PHP","JAVA","C++"), "Science"=> array("Physics","Geography","Math"), ); function treeView($book){ $markUp = ""; foreach($book as $cate => $subj){ $markUp .= "<li>".((is_array($subj))?$cate.treeView($subj):$subj)."</li>"; } return "<ul>$markUp</ul>"; } treeView($book); //------------------- The result is what I expected language English Franch Arabic Programming PHP JAVA C++ Science Physics Geography Math I want to do the following (adding class) <ul> <li class="language">language <ul> <li>English</li> <li>Franch</li> <li>Arabic</li> </ul> </li> <li class="Programming">Programming <ul> <li>PHP</li> <li>JAVA</li> <li>C++</li> </ul> </li> <li class="Science">Science <ul> <li>Physics</li> <li>Geography</li> <li>Math</li> </ul> </li> </ul> Your help is highly appreciated Thank you.
  2. Hi. I need help on how should I print the results using a foreach loop or for loop in a multi-dimensional array. The output should be something like this: ---------------------------------- CustomerNumber CustomerName - Phone - Address ---------------------------------- and if there is a two CustomerName but a same CustomerName, output should be like this: ---------------------------------- CustomerNumber CustomerName - Phone - Address CustomerName - Phone - Address ---------------------------------- Please need help..Thanks... Here is sample of my code: <?phpinclude 'mysql_connect.inc';echo "</br></br>";[/font][/color] $query = "SELECT * FROM customers";$result = mysqli_query($conn, $query);while($row = mysqli_fetch_array($result)){$header = $row["customerNumber"];$details = $row["customerName"]."^".$row["phone"]."^".$row["addressLine1"];$array[$header][$details] = "header & details";} foreach($array as $arr1){$key = key($arr1);echo $key."</br>";} echo "<hr></br>test by: Lloyd Liongson";?>
×
×
  • Create New...