Search Results

Search found 15059 results on 603 pages for 'associative array'.

Page 1/603 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP Associative array sort

    - by Mithun
    I have an array like one below. Currently it is sorted alphabetically by the OwnerNickName field. Now i want to brig the array entry with OwnerNickName 'My House' as the first entry of the array and rest sorted alphabetically by OwnerNickName. Any idea? Array ( [0318B69D-5DEB-11DF-9D7E-0026B9481364] => Array ( [OwnerNickName] => andy [Rooms] => Array ( [0] => Array ( [Label] => Living Room [RoomKey] => FC795A73-695E-11DF-9D7E-0026B9481364 ) ) ) [286C29DE-A9BE-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => anton [Rooms] => Array ( [0] => Array ( [Label] => KidsRoom [RoomKey] => E79D7991-64DC-11DF-9D7E-0026B9481364 ) [1] => Array ( [Label] => Basement [RoomKey] => CC12C0C4-68AA-11DF-9D7E-0026B9481364 ) [2] => Array ( [Label] => Family Room [RoomKey] => 67A280D4-64D9-11DF-9D7E-0026B9481364 ) ) ) [8BE18F84-AC22-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => mike [Rooms] => Array ( [0] => Array ( [Label] => Family Room [RoomKey] => 1C6AFB39-6835-11DF-9D7E-0026B9481364 ) ) ) [29B455DE-A9BC-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => My House [Rooms] => Array ( [0] => Array ( [Label] => Basement [RoomKey] => 61ECFAB2-6376-11DF-9D7E-0026B9481364 ) [1] => Array ( [Label] => Rec Room [RoomKey] => 52B8B781-6376-11DF-9D7E-0026B9481364 ) [2] => Array ( [Label] => Deck [RoomKey] => FFEB4102-64DE-11DF-9D7E-0026B9481364 ) [3] => Array ( [Label] => My Room2 [RoomKey] => 112473E4-64DF-11DF-9D7E-0026B9481364 ) [4] => Array ( [Label] => Bar Room [RoomKey] => F82C47A8-64DE-11DF-9D7E-0026B9481364 ) ) ) )

    Read the article

  • Build associative array based on values of another associative array

    - by macek
    I'm looking for an elegant way to turn this array: Array ( [foo] => 1 [bar] => 1 [zim] => 3 [dib] => 6 [gir] => 1 [gaz] => 3 ) Into this array: Array ( [1] => Array ( foo, bar, gir ), [3] => Array ( zim, gaz ), [6] => Array ( dib ) ) Note:, there is no relationship between the keys or values. They are completely arbitrary and used as examples only. The resulting array should be an associative array grouped by the values of the input array. Thanks!

    Read the article

  • Compare two associative arrays and create a new array with the matched arrays, PHP

    - by user194630
    I have this two arrays: $arr1=array( array("id" => 8, "name" => "test1"), array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); $arr2=array( array("id" => 3), array("id" => 4) ); How can i "extract" arrays from $arr1, where id have same value in $arr2, into a new array and leave the extracted array also in a new array, without taking into account key orders? The output i am looking for should be: $arr3=array( array("id" => 8, "name" => "test1") ); $arr4=array( array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); Thanks

    Read the article

  • Searching for a key in a multi dimensional array and adding it to another array [migrated]

    - by Moha
    Let's say I have two multi dimensional arrays: array1 ( stuff1 = array ( data = 'abc' ) stuff2 = array ( something = '123' data = 'def' ) stuff3 = array ( stuff4 = array ( data = 'ghi' ) ) ) array2 ( stuff1 = array ( ) stuff3 = array ( anything = '456' ) ) What I want is to search the key 'data' in array1 and then insert the key and value to array2 regardless of the depth. So wherever key 'data' exists in array1 it gets added to array2 with the exact depth (and key names) as in array1 AND without modifying any other keys. How can I do this recursively?

    Read the article

  • return a php associative array to javascript array

    - by Eric Sim
    I am trying to return a php associative array to javascript array through ajaxRequest.responseText Here's what I do. First in php, I do this: $encoded = json_encode($thisarray); echo $encoded; If I echo $encoded, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"} Then in js script, thisarray = new Array(); thisarray = ajaxRequest.responseText; If I alert thisarray, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"} That's wrong since alerting an array should give error. But in this case, when I alert thisarray, I get the full array!! Needless to say, I can't call my value out of thisarray, since it is yet defined as an array. Anyone can tell me what am I missing here?

    Read the article

  • Checking if an array contains all elements of another array

    - by mozcelikors
    I'm designing an electrical engineering application. However, i'm stuck on this: I have the following array <?php // Static Array $GroupOfEight = array ( array(0,1,3,2,4,5,7,6), array(4,5,6,7,16,12,13,14), array(12,13,15,14,8,9,11,10), array(2,6,14,10,3,7,15,11), array(1,3,5,7,13,15,9,11), array(0,4,12,8,1,5,13,9), array(0,1,3,2,8,9,11,10) ); ?> And I have another array, but this one is one dimensional. <?php $myStack = array(0,1,3,2,4,5,7,6); //Dynamic, gets value by POST method. ?> What I want to do is to check if $myStack is equal to any sub array of $GroupOfEight array. ( Number ordering is not important. The script should just check if every elements contained. It's not important if their order is same or not. ) Here is what I've done to solve the issue so far: <?php //Check if stackArray contains 8group for($i=0; $i<count($GroupOfEight);$i++) for($j=0; $j<count($GroupOfEight[$i]); $j++){ //$containsSearch = count(array_intersect($search_this,$all)) == count($search_this); $containsSearch = count(array_intersect($stackArray,$GroupOfEight[$j])) == count($stackArray); echo $containsSearch; } ?> Please help me correct my code or introduce me the solution of this issue, Thanks.

    Read the article

  • sort associative array PHP

    - by jim smith
    Here's my array, how do I sort it by saleref? Array ( [xml] => Array ( [sale] => Array ( [0] => Array ( [saleref] => 12345 [saleline] => 1 [product] => producta [date] => 19/ 3/10 [manifest] => 0 [qty] => 1 [nextday] => [order_status] => ) [1] => Array ( [saleref] => 12344 [saleline] => 1 [product] => productb [date] => 18/ 3/10 [manifest] => 11892 [qty] => 1 [nextday] => [order_status] => )

    Read the article

  • How to pass an associative array as argument to a function in Bash?

    - by niksfirefly
    How do you pass an associative array as an argument to a function? Is this possible in Bash? The code below is not working as expected: function iterateArray { local ADATA="${@}" # associative array for key in "${!ADATA[@]}" do echo "key - ${key}" echo "value: ${ADATA[$key]}" done } Passing associative arrays to a function like normal arrays does not work: iterateArray "$A_DATA" or iterateArray "$A_DATA[@]"

    Read the article

  • array_splice() - Numerical Offsets of Associative Arrays

    - by Alix Axel
    I'm trying to do something but I can't find any solution, I'm also having some trouble putting it into works so here is a sample code, maybe it'll be enough to demonstrate what I'm aiming for: $input = array ( 'who' => 'me', 'what' => 'car', 'more' => 'car', 'when' => 'today', ); Now, I want to use array_splice() to remove (and return) one element from the array: $spliced = key(array_splice($input, 2, 1)); // I'm only interested in the key... The above will remove and return 1 element (third argument) from $input (first argument), at offset 2 (second argument), so $spliced will hold the value more. I'll be iterating over $input with a foreach loop, I know the key to be spliced but the problem is I don't know its numerical offset and since array_splice only accepts integers I don't know what to do. A very dull example: $result = array(); foreach ($input as $key => $value) { if ($key == 'more') { // Remove the index "more" from $input and add it to $result. $result[] = key(array_splice($input, 2 /* How do I know its 2? */, 1)); } } I first though of using array_search() but it's pointless since it'll return the associative index.... How do I determine the numerical offset of a associative index?

    Read the article

  • Converting a flat array to a nested array

    - by matte
    Hi, I am trying to convert a flat array to a nested array depending on the 'level' data of each array item. 'level' data shows us if current array item is a child, a parent or a sibling. Here is the flat array: $sequentialArray = array( array('title'=>'Page 1', 'level'=>0), array('title'=>'Page 2', 'level'=>0), array('title'=>'Page 3', 'level'=>1), array('title'=>'Page 4', 'level'=>1), array('title'=>'Page 5', 'level'=>2), array('title'=>'Page 6', 'level'=>0), array('title'=>'Page 7', 'level'=>1), array('title'=>'Page 8', 'level'=>0) ); And here is the expected result: $nestedArray = array( array('title'=>'Page 1', 'children'=>array()), array('title'=>'Page 2', 'children'=>array( array('title'=>'Page 3', 'children'=>array()), array('title'=>'Page 4', 'children'=>array( array('title'=>'Page 5', 'children'=>array()) )), )), array('title'=>'Page 6', 'children'=>array( array('title'=>'Page 7', 'children'=>array()) )), array('title'=>'Page 8', 'children'=>array()), ); I tried using references with array indexes but that didn't work. Any ideas?

    Read the article

  • sort associative array in awk - help?

    - by Richard
    Hi all, I have an associative array in awk that gets populated like this... chr_count[$3]++ When I try to print my chr_counts I use this: for (i in chr_count) { print i,":",chr_count[i]; } But not surprisingly, the order of i is not sorted in any way. Is there an easy way to iterate over the sorted "keys" of chr_count?

    Read the article

  • php if array key exists inside multidimentional array

    - by Richard
    how can i check if logo exists in this array called $attachements print_r is below: Array ( [logo] = /home/richar2/public_html/ioagh/images/stories/jreviews/20100510115659_1_img.gif ) when theres no logo, the array print_r's Array ( ) i tried: if (isset($attachments['logo']) ) {..} but the conditional code runs when there is no logo

    Read the article

  • C++ Static array vs. Dynamic array?

    - by user69514
    What is the difference between a static array and a dynamic array in C++? I have to do an assignment for my class and it says not to use static arrays, only dynamic arrays. I've looked in the book and online, but I don't seem to understand. I thought static was created at compile time and dynamic at runtime, but I might be mistaken this with memory allocation. Can you explain to me the difference between static array and dynamic array in C++? Thnaks.

    Read the article

  • How to sort a date array in PHP

    - by Click Upvote
    I have an array in this format: Array ( [0] => Array ( [28th February, 2009] => 'bla' ) [1] => Array ( [19th March, 2009] => 'bla' ) [2] => Array ( [5th April, 2009] => 'bla' ) [3] => Array ( [19th April, 2009] => 'bla' ) [4] => Array ( [2nd May, 2009] => 'bla' ) ) I want to sort them out in the ascending order of the dates (based on the month, day, and year). What's the best way to do that? Originally the emails are being fetched in the MySQL date format, so its possible for me to get the array in this state: Array [ ['2008-02-28']='some text', ['2008-03-06']='some text' ] Perhaps when its in this format, I can loop through them, remove all the '-' (hyphen) marks so they are left as integars, sort them using array_sort() and loop through them yet again to sort them? Would prefer if there was another way as I'd be doing 3 loops with this per user. Thanks. Edit: I could also do this: $array[$index]=array('human'=>'28 Feb, 2009', 'db'=>'20080228', 'description'=>'Some text here'); But using this, would there be any way to sort the array based on the 'db' element alone? Edit 2: Updated initial var_dump

    Read the article

  • javascript "associative" array access

    - by cp
    Hello I have a simple simulated aarray with two elements: bowl["fruit"]="apple"; bowl["nuts"]="brazilian"; I can access the value with an event like this: onclick="testButton00_('fruit')">with `testButton00_` function testButton00_(key){ var t = bowl[key]; alert("testButton00_: value = "+t); } However whenever I try to access the aarray from within code with a key that is just a non-explicit string I get undefined. Do I have somehow have to pass the parameter with the escaped 'key'. Any ideas? tia.

    Read the article

  • Formatting associative array declaration

    - by Drew Stephens
    When declaring an associative array, how do you handle the indentation of the elements of the array? I've seen a number of different styles (PHP syntax, since that's what I've been in lately). This is a pretty picky and trivial thing, so move along if you're interested in more serious pursuits. 1) Indent elements one more level: $array = array( 'Foo' => 'Bar', 'Baz' => 'Qux' ); 2) Indent elements two levels: $array = array( 'Foo' => 'Bar', 'Baz' => 'Qux' ); 3) Indent elements beyond the array constructor, with closing brace aligned with the start of the constructor: $array = array( 'Foo' => 'Bar', 'Baz' => 'Qux' ); 4) Indent elements beyond the array construct, with closing brace aligned with opening brace: $array = array( 'Foo' => 'Bar', 'Baz' => 'Qux' ); Personally, I like #3—the broad indentation makes it clear that we're at a break point in the code (constructing the array), and having the closing brace floating a bit to the left of all of the array's data makes it clear that this declaration is done.

    Read the article

  • Sorting a Multidimensional array...

    - by sologhost
    I need to sort an array that can look like this: $array[4][0] = array('id' => 1, 'value' => 2); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][1] = array('id' => 1, 'value' => 0); $array[1][3] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][0] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); But needs to be sorted and returned as this: $array[1][0] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][3] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][0] = array('id' => 1, 'value' => 2); $array[4][1] = array('id' => 1, 'value' => 0); Can anyone help me? It needs to sort both indexes of the array from lowest to highest index value. Sounds simple enough, but I'm having the hardest time trying to figure this out, while still keeping the values intact. Please help someone...

    Read the article

  • jQuery - change a list of elements to an associative array

    - by Brian M. Hunt
    Given an associative array (of the sort returned by jQuery.serializeArray()) like this: [ { 'name': 'abc', 'value': 'aaa', '__proto__': [Object] }, { 'name': 'def', 'value': 'bbb', '__proto__': [Object] }, { 'name': 'abc', 'value': 'ccc', '__proto__': [Object] } ] How can one convert this, using either jQuery or just javascript, to an associative array of name: [values] like this: { 'abc': ['aaa', 'ccc'], 'def': ['bbb'] } This seems to essentially be the inverse of this question: Build associative array based on values of another associative array... but in Javascript (not PHP). I wasn't able to find this question on Stackoverflow, though I thought it would have been asked. Thank you for reading. Brian

    Read the article

  • Bash scripting - Iterating through "variable" variable names for a list of associative arrays

    - by user1550254
    I've got a variable list of associative arrays that I want to iterate through and retrieve their key/value pairs. I iterate through a single associative array by listing all its keys and getting the values, ie. for key in "${!queue1[@]}" do echo "key : $key" echo "value : ${queue1[$key]}" done The tricky part is that the names of the associative arrays are variable variables, e.g. given count = 5, the associative arrays would be named queue1, queue2, queue3, queue4, queue5. I'm trying to replace the sequence above based on a count, but so far every combination of parentheses and eval has not yielded much more then bad substitution errors. e.g below: for count in {1,2,3,4,5} do for key in "${!queue${count}[@]}" do echo "key : $key" echo "value : ${queue${count}[$key]}" done done Help would be very much appreciated!

    Read the article

  • Read array dump output and generates the correspondent XML file

    - by Christian
    Hi, The text below is the dump of a multidimensional array, dumped by the var_dump() PHP function. I need a Java function that reads a file with a content like this (attached) and returns it in XML. For a reference, in site http://pear.php.net/package/Var_Dump/ you can find the code (in PHP) that generates dumps in XML, so all neeeded logic is there (I think). I will be waiting for your feedback. Regards, Christian array(1) { ["Processo"]= array(60) { ["Sistema"]= string(6) "E-PROC" ["UF"]= string(2) "RS" ["DataConsulta"]= string(19) "11/05/2010 17:59:17" ["Processo"]= string(20) "50000135320104047100" ["NumRegistJudici"]= string(20) "50000135320104047100" ["IdProcesso"]= string(30) "711262958983115560390000000001" ["SeqProcesso"]= string(1) "1" ["Autuado"]= string(19) "08/01/2010 12:04:47" ["StatusProcesso"]= string(1) "M" ["ComSituacaoProcesso"]= string(2) "00" ["Situacao"]= string(9) "MOVIMENTO" ["IdClasseJudicial"]= string(10) "0000000112" ["DesClasse"]= string(18) "INQUÉRITO POLICIAL" ["CodClasse"]= string(6) "000120" ["SigClasse"]= string(3) "INQ" ["DesTipoInquerito"]= string(0) "" ["CodCompetencia"]= string(2) "21" ["IdLocalidadeJudicial"]= string(4) "7150" ["ClasseSigAutor"]= string(5) "AUTOR" ["ClasseDesAutor"]= string(5) "AUTOR" ["ClasseSigReu"]= string(7) "INDICDO" ["ClasseDesReu"]= string(9) "INDICIADO" ["ClasseCodReu"]= string(2) "64" ["TipoAcao"]= string(8) "Criminal" ["TipoProcessoJudicial"]= string(1) "2" ["CodAssuntoPrincipal"]= string(6) "051801" ["CodLocalidadeJudicial"]= string(2) "00" ["IdAssuntoPrincipal"]= string(4) "1504" ["IdLocalizadorOrgaoPrincipal"]= string(30) "711264420823128430420000000001" ["ChaveConsulta"]= string(12) "513009403710" ["NumAdministrativo"]= NULL ["Magistrado"]= string(28) "RICARDO HUMBERTO SILVA BORNE" ["IdOrgaoJuizo"]= string(9) "710000085" ["IdOrgaoJuizoOriginario"]= string(9) "710000085" ["DesOrgaoJuizo"]= string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoJuizo"]= string(10) "RSPOACR02F" ["CodOrgaoJuizo"]= string(9) "RS0000085" ["IdOrgaoSecretaria"]= string(9) "710000084" ["DesOrgaoSecretaria"]= string(31) "02a VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoSecretaria"]= string(9) "RSPOACR02" ["CodOrgaoSecretaria"]= string(9) "RS0000084" ["IdSigilo"]= string(1) "0" ["IdUsuario"]= string(30) "711262951173995330420000000001" ["DesSigilo"]= string(10) "Sem Sigilo" ["Localizador"]= string(25) "EM TRÂMITE ENTRE PF E MPF" ["TotalCda"]= int(0) ["DesIpl"]= string(8) "012/2010" ["Assunto"]= array(1) { [0]= array(4) { ["IdAssuntoJudicial"]= string(4) "1504" ["SeqAssunto"]= string(1) "1" ["CodAssunto"]= string(6) "051801" ["DesAssunto"]= string(84) "Moeda Falsa / Assimilados (arts. 289 e parágrafos e 290), Crimes contra a Fé Pública" } } ["ParteAutor"]= array(1) { [0]= array(12) { ["IdPessoa"]= string(30) "771230778800100040000000000508" ["TipoPessoa"]= string(3) "ENT" ["Nome"]= string(15) "POLÍCIA FEDERAL" ["Identificacao"]= string(14) "79621439000191" ["SinPartePrincipal"]= string(1) "S" ["IdProcessoParte"]= string(30) "711262958983115560390000000002" ["IdProcessoParteAtributo"]= NULL ["IdRepresentacao"]= NULL ["TipoRepresentacao"]= NULL ["AtributosProcessoParte"]= NULL ["Relacao"]= NULL ["Procurador"]= array(6) { [0]= array(4) { ["Nome"]= string(25) "SOLON RAMOS CARDOSO FILHO" ["Sigla"]= string(13) "cor-sr-dpf-rs" ["IdUsuarioProcurador"]= string(30) "711262893271855450420000000001" ["TipoUsuario"]= string(3) "CPF" } [1]= array(4) { ["Nome"]= string(18) "LUCIANA IOP CECHIN" ["Sigla"]= string(11) "luciana.lic" ["IdUsuarioProcurador"]= string(30) "711262946806708880420000000001" ["TipoUsuario"]= string(3) "CPF" } [2]= array(4) { ["Nome"]= string(31) "ALEXANDRE DA SILVEIRA ISBARROLA" ["Sigla"]= string(15) "drcor-sr-dpf-rs" ["IdUsuarioProcurador"]= string(30) "711262949451860560420000000001" ["TipoUsuario"]= string(3) "CPF" } [3]= array(4) { ["Nome"]= string(24) "JUCÉLIA TERESINHA PISONI" ["Sigla"]= string(11) "jucelia.jtp" ["IdUsuarioProcurador"]= string(30) "711262950492275450420000000001" ["TipoUsuario"]= string(3) "CPF" } [4]= array(4) { ["Nome"]= string(32) "MARCOS ANTONIO SIQUEIRA PICININI" ["Sigla"]= string(13) "picinini.masp" ["IdUsuarioProcurador"]= string(30) "711262951173995330420000000001" ["TipoUsuario"]= string(3) "APF" } [5]= array(4) { ["Nome"]= string(20) "PRISCILLA BURLACENKO" ["Sigla"]= string(12) "priscilla.pb" ["IdUsuarioProcurador"]= string(30) "711262955631630740420000000001" ["TipoUsuario"]= string(3) "DPF" } } } } ["ParteReu"]= array(1) { [0]= array(11) { ["IdPessoa"]= string(30) "711262958983115560390000000001" ["TipoPessoa"]= string(2) "PF" ["Nome"]= string(8) "A APURAR" ["Identificacao"]= NULL ["SinPartePrincipal"]= string(1) "S" ["IdProcessoParte"]= string(30) "711262958983115560390000000001" ["IdProcessoParteAtributo"]= NULL ["IdRepresentacao"]= NULL ["TipoRepresentacao"]= NULL ["AtributosProcessoParte"]= NULL ["Relacao"]= NULL } } ["OutraParte"]= array(1) { [0]= array(10) { ["Nome"]= string(26) "MINISTÉRIO PÚBLICO FEDERAL" ["CodTipoParte"]= string(3) "114" ["DesTipoParte"]= string(3) "MPF" ["SinPolo"]= string(1) "N" ["Identificacao"]= string(13) "3636198000192" ["SinPartePrincipal"]= string(1) "N" ["IdProcessoParte"]= string(30) "711262958983115560390000000003" ["IdPessoa"]= string(30) "771230778800100040000000000217" ["TipoPessoa"]= string(3) "ENT" ["Procurador"]= array(1) { [0]= array(4) { ["Nome"]= string(25) "MARIA VALESCA DE MESQUITA" ["IdUsuarioProcurador"]= string(30) "711265220162198740420000000001" ["TipoUsuario"]= string(1) "P" ["Sigla"]= string(5) "pr528" } } } } ["DadoComplementar"]= array(6) { [0]= array(5) { ["DesDadoComplem"]= string(21) "Antecipação de Tutela" ["ValorDadoComplem"]= string(13) "Não Requerida" ["IdDadoComplementar"]= string(1) "1" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000003" ["IdDadoComplementarValor"]= string(1) "4" } [1]= array(5) { ["DesDadoComplem"]= string(16) "Justiça Gratuita" ["ValorDadoComplem"]= string(13) "Não Requerida" ["IdDadoComplementar"]= string(1) "4" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000001" ["IdDadoComplementarValor"]= string(1) "3" } [2]= array(5) { ["DesDadoComplem"]= string(15) "Petição Urgente" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "5" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000004" ["IdDadoComplementarValor"]= string(1) "2" } [3]= array(5) { ["DesDadoComplem"]= string(22) "Prioridade Atendimento" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "2" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000006" ["IdDadoComplementarValor"]= string(1) "2" } [4]= array(5) { ["DesDadoComplem"]= string(9) "Réu Preso" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "6" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000002" ["IdDadoComplementarValor"]= string(1) "2" } [5]= array(5) { ["DesDadoComplem"]= string(24) "Vista Ministério Público" ["ValorDadoComplem"]= string(3) "Sim" ["IdDadoComplementar"]= string(1) "3" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000005" ["IdDadoComplementarValor"]= string(1) "1" } } ["SemPrazoAbrir"]= bool(true) ["Evento"]= array(8) { [0]= array(18) { ["IdProcessoEvento"]= string(30) "711269271039215440420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "166" ["SeqEvento"]= string(1) "8" ["DataHora"]= string(19) "22/03/2010 12:19:16" ["SinExibeDesEvento"]= string(1) "S" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= string(7) "90 DIAS" ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(7) "ap18785" ["idUsuario"]= string(30) "711263330517182580420000000001" ["DesPeticao"]= string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]= string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [1]= array(18) { ["IdProcessoEvento"]= string(30) "711269032501923580420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "166" ["SeqEvento"]= string(1) "7" ["DataHora"]= string(19) "19/03/2010 18:04:59" ["SinExibeDesEvento"]= string(1) "S" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= string(7) "90 DIAS" ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(5) "pr700" ["idUsuario"]= string(30) "711262976146980920420000000002" ["DesPeticao"]= string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]= string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [2]= array(19) { ["IdProcessoEvento"]= string(30) "711268077089625240420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "165" ["SeqEvento"]= string(1) "6" ["DataHora"]= string(19) "08/03/2010 16:55:48" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(2) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711268077089625240420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "CERT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711268077089625240420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "DESP" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [3]= array(19) { ["IdProcessoEvento"]= string(30) "711267732906972600420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "5" ["DataHora"]= string(19) "04/03/2010 17:20:29" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(5) "pr700" ["idUsuario"]= string(30) "711262976146980920420000000002" ["Documento"]= array(1) { [0]= array(6) { ["IdUsuario"]= string(30) "711262976146980920420000000002" ["IdDocumento"]= string(30) "711267732906972600420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(3) "PET" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [4]= array(19) { ["IdProcessoEvento"]= string(30) "711265889365256290420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "165" ["SeqEvento"]= string(1) "4" ["DataHora"]= string(19) "11/02/2010 09:59:04" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(2) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711265222866995860420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "PORT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711265222866995860420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [5]= array(19) { ["IdProcessoEvento"]= string(30) "711263991150788270420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "3" ["DataHora"]= string(19) "20/01/2010 10:50:05" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(4) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [6]= array(19) { ["IdProcessoEvento"]= string(30) "711263955058688620420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "2" ["DataHora"]= string(19) "20/01/2010 00:40:39" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(6) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [4]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000005" ["SeqDocumento"]= string(1) "5" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [5]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000006" ["SeqDocumento"]= string(1) "6" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [7]= array(19) { ["IdProcessoEvento"]= string(30) "711262958983115560390000000001" ["IdEvento"]= string(3) "430" ["IdTipoPeticaoJudicial"]= NULL ["SeqEvento"]= string(1) "1" ["DataHora"]= string(19) "08/01/2010 12:04:47" ["SinExibeDesEvento"]= NULL ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "0" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["CodEvento"]= string(6) "030101" ["DesEvento"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(4) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "PORT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "OFIC" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DescricaoCompleta"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" } } ["ValCausa"]= string(4) "0.00" ["OrgaoJul"]= string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["CodOrgaoJul"]= string(9) "RS0000085" ["OrgaoColegiado"]= NULL ["CodOrgaoColegiado"]= NULL ["CodOrgaoColegiadoSecretaria"]= NULL } }

    Read the article

  • PHP - "tabulate" array - make levels from elements

    - by Moha
    If I have an array like this: Array ( [0] => field_schools [1] => und [2] => 0 [3] => field_school [4] => und [5] => 0 [6] => value ) How can I make an array like this from it? array ( [field_schools] => array ( [und] => array ( [0] => array ( [field_school] => array ( [und] => array ( [0] => array ( [value] => something ) ) ) ) ) ) ) I want to specify the 'value' myself.

    Read the article

  • Length of array (C) [migrated]

    - by physics
    I have an array of 10 elements. This array stocks some informations but last information is ended by an symbol "END" (which is -1). for exemple: array[0] = 1; array[1] = 1; array[2] = 1; array[3] = 1; array[4] = 1; array[5] = 1; array[6] = END; So in this case the length is 7 instead of 10. Here is my algorithm: for (i = 0; (i < 10) && (array[i] != END); i++) { ; } at the end i contains the length. Is it correct or there is an other methode?

    Read the article

  • Converting a PHP associative array to a JSON associative array

    - by Extrakun
    I am converting a look-up table in PHP which looks like this to JavaScript using json_encode: AbilitiesLookup Object ( [abilities:private] => Array ( [1] => Ability_MeleeAttack Object ( [abilityid:protected] => [range:protected] => 1 [name:protected] => MeleeAttack [ability_identifier:protected] => MeleeAttack [aoe_row:protected] => 1 [aoe_col:protected] => 1 [aoe_shape:protected] => [cooldown:protected] => 0 [focusCost:protected] => 0 [possibleFactions:protected] => 2 [abilityDesc:protected] => Basic Attack ) .....snipped... And in JSON, it is: {"1":{"name":"MeleeAttack","fof":"2","range":"1","aoe":[null,"1","1"],"fp":"0","image":"dummy.jpg"},.... The problem is I get a JS object, not an array, and the identifier is a number. I see 2 ways around this problem - either find a way to access the JSON using a number (which I do not know how) or make it such that json_encode (or some other custom encoding functions) can give a JavaScript associative array. (Yes, I am rather lacking in my JavaScript department). Note: The JSON output doesn't match the array - this is because I do a manual json encoding for each element in the subscript, before pushing it onto an array (with the index as the key), then using json_encode on it. To be clear, the number are not sequential because it's an associative array (which is why the JSON output is not an array).

    Read the article

  • Array Unique in two dimentional array in PHP

    - by Kaiser
    Hi I have an array that looks like this : Array ( [0] => Array ( [x] => 01 [y] => 244 ) [1] => Array ( [x] => 02 [y] => 244 ) [2] => Array ( [x] => 03 [y] => 244 ) [3] => Array ( [x] => 04 [y] => 243 ) [4] => Array ( [x] => 05 [y] => 243 ) [5] => Array ( [x] => 05 [y] => 244 ) [6] => Array ( [x] => 06 [y] => 242 ) [7] => Array ( [x] => 06 [y] => 243 ) [8] => Array ( [x] => 07 [y] => 243 ) [9] => Array ( [x] => 08 [y] => 243 ) [10] => Array ( [x] => 09 [y] => 242 ) [11] => Array ( [x] => 10 [y] => 244 ) [12] => Array ( [x] => 12 [y] => 243 ) [13] => Array ( [x] => 13 [y] => 243 ) [14] => Array ( [x] => 13 [y] => 243 ) [15] => Array ( [x] => 15 [y] => 243 ) ) x represent days and y values of a certain variable. I would like to display an array of unique days x ( last element ) and values y pragmatically. for example day 6 I have two y values but I want to display only the last one ( 243 ). Thanks for help

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >