My PHP skills are not that good when it comes to dealing with Arrays, so I'm requesting a little assistance. If someone could provide me with some example code that would be great.
I need to store the values of the array keys in a variable.
For example, the API is giving me back the following when using the getSubmittedTicket function.
CODE
Array
(
[id] => 1
[mask] => MLY-633303
[department] => 1
[status] => 1
[priority] => 1
[startdate] => 1243844175
[lastactivity] => 1243848115
[subject] => Test Ticket
[posts] => Array
(
[0] => Array
(
[id] => 1
[date] => 1243844175
[userid] => 1
[fullname] => Carolina Johnson
[email] => cmeneses89@yahoo.com
[edited] =>
[editedbystaffid] => 0
[editeddate] => 0
[ishtml] =>
[staffid] => 0
[contents] => Simply a test ticket
[attachments] => Array
(
)
)
[1] => Array
(
[id] => 2
[date] => 1243848115
[userid] => 0
[fullname] => Chris Hankins
[email] => sales@afakedomain.com
[edited] =>
[editedbystaffid] => 0
[editeddate] => 0
[ishtml] =>
[staffid] => 1
[contents] => Everything is fine on this account, please take a look at it and stop being a idiot.<br />
<br />
Thanks,<br />
Chris
[attachments] => Array
(
)
)
)
)
(
[id] => 1
[mask] => MLY-633303
[department] => 1
[status] => 1
[priority] => 1
[startdate] => 1243844175
[lastactivity] => 1243848115
[subject] => Test Ticket
[posts] => Array
(
[0] => Array
(
[id] => 1
[date] => 1243844175
[userid] => 1
[fullname] => Carolina Johnson
[email] => cmeneses89@yahoo.com
[edited] =>
[editedbystaffid] => 0
[editeddate] => 0
[ishtml] =>
[staffid] => 0
[contents] => Simply a test ticket
[attachments] => Array
(
)
)
[1] => Array
(
[id] => 2
[date] => 1243848115
[userid] => 0
[fullname] => Chris Hankins
[email] => sales@afakedomain.com
[edited] =>
[editedbystaffid] => 0
[editeddate] => 0
[ishtml] =>
[staffid] => 1
[contents] => Everything is fine on this account, please take a look at it and stop being a idiot.<br />
<br />
Thanks,<br />
Chris
[attachments] => Array
(
)
)
)
)
The PHP code I'm using wont actually give back the "Post" only the ticket details at the beginning.
I'm looking to do something like this . . .
CODE
<?
echo "$result[fullname][0]"
?>
echo "$result[fullname][0]"
?>
This would then echo "Carolina Johnson".
Can someone please give me some advise on looping through this information and storing the values in variables?
Thanks!
Sign In »
Register Now!
Help

Back to top








