Jump to content

Search the Community

Showing results for tags 'Multidimensional'.

  • 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 3 results

  1. Hello, I have this array print: Array ( [0] => Array ( [name] => color [value] => red ) [1] => Array ( [name] => color [value] => blue ) [2] => Array ( [name] => color [value] => green ) [3] => Array ( [name] => age [value] => 16 ) ) I want to receive this result: Array ( [color] => Array ( [name] => color [value] => red, blue, green ) [age] => Array ( [name] => age [value] => 16 ) ) it works using the following php code: foreach ($feature_names as $row) { if (!isset($result[$row["name"]])) { $result[$row["name"]]["name"] = $row["name"]; $result[$row["name"]]["value"] = $row["value"]; } else { $result[$row["name"]]["value"] .= ", " . $row["value"]; } } How ever in PHP 7.1 using the code $result[$row["name"]]["name"] = $row["name"]; generates an error. Does someone know a work around? Thanks in advance!
  2. Hello, I'm currently learning JavaScript and I plan to work a lot with arrays. I store all arrays in external files and use JSON to access them. Now I wanted to read the names of all arrays that are nested in one main array to create a navigation list but I don't know how to do that. This is an example of a JSON file I use: {"MainArray":[ {"SubArray1":[{ ... }] }, {"SubArray2":[{ ... }] }, {"SubArray3":[{ ... }] } ]} How do I get the names of all SubArrays? I tried this // arr is a JSON-parsed string function myFunction(arr) { var out = ""; var i; for(i = 0; i < arr.MainArray.length; i++) { out += arr.MainArray[i].toString() + '<br>'; } document.getElementById("aso").innerHTML = out; } but it only creates a list of "[object Object]" items. Should I create another JSON file where all array names are listed instead?
  3. <script>int[][] num = new int[4][5];num[1][1]={0,1,2,3,4};alert(num[1][2]);</script> This give my an error " Uncaught SyntaxError: Unexpected token ] " (shown by chrome) #for the "int[][] num = new int[4][5];" line Please help.
×
×
  • Create New...