Register for your free account! | Forgot your password?

You last visited: Today at 17:27

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Array

Discussion on Array within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2014
Posts: 10
Received Thanks: 5
Array

PHP Code:
ProtocolNode Object ( [tag:ProtocolNode:private] => message [attributeHash:ProtocolNode:private] => Array ( [from] => 4915204957750@s.whatsapp.net [id] => 1421333354-1233 [offline] => [type] => text [t] => 1413364225 [notify] => Peter Pan ) [children:ProtocolNode:private] => Array ( [0] => ProtocolNode Object ( [tag:ProtocolNode:private] => body [attributeHash:ProtocolNode:private] => Array ( ) [children:ProtocolNode:private] => [data:ProtocolNode:private] => Testlauf ) ) [data:ProtocolNode:private] => ) 
Jemand eine Idee wie an die Array-Werte komme als Beispiel z.B an die Nachricht "Testlauf" oder den Namen "Peter Pan"?
Jonаs is offline  
Old 09/20/2014, 03:26   #2
 
Mikesch01's Avatar
 
elite*gold: 203
Join Date: Sep 2007
Posts: 732
Received Thanks: 190
Java? Javascript? .NET?

Welche Programmiersprache benutzt du?
Mikesch01 is offline  
Old 09/20/2014, 03:35   #3
 
elite*gold: 0
Join Date: Aug 2014
Posts: 10
Received Thanks: 5
PHP.
Jonаs is offline  
Old 09/20/2014, 03:41   #4
 
Mikesch01's Avatar
 
elite*gold: 203
Join Date: Sep 2007
Posts: 732
Received Thanks: 190


Bei dir: $array['message']['notify'] wäre "Peter Pan"
Mikesch01 is offline  
Old 09/20/2014, 14:30   #5
 
elite*gold: 0
Join Date: Aug 2014
Posts: 10
Received Thanks: 5
Funktioniert so leider nicht :/
"Undefined index: message"
Jonаs is offline  
Old 09/20/2014, 15:08   #6

 
Mr.Tr33's Avatar
 
elite*gold: 2778
Join Date: Feb 2012
Posts: 3,527
Received Thanks: 1,044
Man muss die Keys angeben und nicht die Values oder ein Mix davon
Code:
$array['attributeHash:ProtocolNode:private']['notify']
Es wäre viel hilfreicher, wenn du es so gepostet hättest:
Code:
ProtocolNode Object ( 
	[tag:ProtocolNode:private] => message 
	[attributeHash:ProtocolNode:private] => Array ( 
		[from] =>  
		[id] => 1421333354-1233 
		[offline] => 0 
		[type] => text 
		[t] => 1413364225 
		[notify] => Peter Pan 
	) 
	[children:ProtocolNode:private] => Array ( 
		[0] => ProtocolNode Object ( 
			[tag:ProtocolNode:private] => body 
			[attributeHash:ProtocolNode:private] => Array ( ) 
			[children:ProtocolNode:private] => 
			[data:ProtocolNode:private] => Testlauf 
		) 
	) 
	[data:ProtocolNode:private] => 
)
Mr.Tr33 is offline  
Old 09/20/2014, 16:09   #7
 
elite*gold: 0
Join Date: Aug 2014
Posts: 10
Received Thanks: 5
Undefined index: attributeHash:ProtocolNoderivate

VAR_DUMP:

PHP Code:
array(1) { [0]=> object(ProtocolNode)#14 (4) { ["tag":"ProtocolNode":private]=> string(7) "message" ["attributeHash":"ProtocolNode":private]=> array(6) { ["from"]=> string(27) "" ["id"]=> string(14) "1421154662-359" ["offline"]=> string(1) "0" ["type"]=> string(4) "text" ["t"]=> string(10) "1411233561" ["notify"]=> string(14) "Peter Pan" } ["children":"ProtocolNode":private]=> array(1) { [0]=> object(ProtocolNode)#9 (4) { ["tag":"ProtocolNode":private]=> string(4) "body" ["attributeHash":"ProtocolNode":private]=> array(0) { } ["children":"ProtocolNode":private]=> NULL ["data":"ProtocolNode":private]=> string(4) "Test" } } ["data":"ProtocolNode":private]=> string(0) "" } } 
PRINT_R:

PHP Code:
Array ( [0] => ProtocolNode Object ( [tag:ProtocolNode:private] => message [attributeHash:ProtocolNode:private] => Array ( [from] => 491718222555@s.whatsapp.net [id] => 1421154662-359 [offline] => [type] => text [t] => 1411233561 [notify] => Peter Pan ) [children:ProtocolNode:private] => Array ( [0] => ProtocolNode Object ( [tag:ProtocolNode:private] => body [attributeHash:ProtocolNode:private] => Array ( ) [children:ProtocolNode:private] => [data:ProtocolNode:private] => Test ) ) [data:ProtocolNode:private] => ) ) 
Jonаs is offline  
Old 09/20/2014, 17:17   #8

 
Mr.Tr33's Avatar
 
elite*gold: 2778
Join Date: Feb 2012
Posts: 3,527
Received Thanks: 1,044
Achso ja klar, du musst es erst einmal richtig umformen, sodass PHP es auch richtig versteht.

Es wäre toller wenn du dir den Quelltext anzeigen lässt (STRG+U) und von dort aus den Inhalt kopierst. Dann ist das nicht alles in einer Zeile.
Mr.Tr33 is offline  
Old 09/20/2014, 17:19   #9
 
elite*gold: 0
Join Date: Aug 2014
Posts: 10
Received Thanks: 5
PROBLEM GELÖST.

$ARRAY[0]->attributeHash['notify'];
Jonаs is offline  
Reply


Similar Threads Similar Threads
[Help] Array looping, sum
03/15/2013 - C/C++ - 3 Replies
Hi, well i got a problem, I am trying to fill my array with random numbers.. and i want to make it so that the filling ends as soon as the sum of filled elements in that array exceeds and integer (lets say int i=50; ) void fillArray() { srand((unsigned)time(0));
Array
06/18/2011 - AutoIt - 0 Replies
Array Fehler Ich habe hier mal wieder einen Fehler den ich nicht beheben kann #include "WebTcp.au3" #include <Array.au3> #Include <File.au3> TCPStartup() _AutoITObject_Startup()
[C#] Array auswerten
10/06/2010 - .NET Languages - 3 Replies
Bitte ab Edit lesen !! Hey, da ich gerade fleißig am C# lernen bin, dachte ich mir mal versuch ich mich mal an einem recht einfachem Programm. Nun, das Programm soll mir eine Datei einlesen und nach einer Eingabe prüfen ob der Inhalt in der Datei vorhanden is und dann halt sagen Ja oder Nein. Leider erklärt mein Buch wie ich Arrays erstelle, aber nich wie man sie auswerten kann. Ich bin wenigstens schon so Weit das ich weiß das ich am besten mit "ReadAllLines" arbeiten sollte. Diese...
Array-Problem
05/13/2010 - AutoIt - 0 Replies
Also ich habe die System-Zeit und das System-Datum in einen Array geladen: #include <Date.au3> Global $dat, $tim $dat = _NowCalcDate() If @error Then Return $tim = _NowTime(5)



All times are GMT +1. The time now is 17:28.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.