Cake PHP how to add array to find fields - php

I'm using cakephp 2.x and I would like to get certain element as field from my model. the problem is with my structure. If I use find all then I recieve this:
array(9) {
[0]=> ...
[1]=>
array(7) {
["Person"]=>
array(18) {
["id"]=>
int(2)
["imie"]=>
string(6) "STEFAN"
["nazwisko"]=>
string(8) "ŚMIAŁY"
["tel"]=>
string(13) "+55 648989748"
["mob"]=>
string(13) "+87 489747489"
["email"]=>
string(25) "HSDJKAHSDJK#HSDFJASHF.CIJ"
["tytul_naukowy"]=>
string(7) "TEZ NIE"
["data_od"]=>
string(10) "2017-02-16"
["data_do"]=>
NULL
["object_id"]=>
int(-1)
["object_type_id"]=>
int(2)
["duty_id"]=>
int(28)
["created"]=>
string(22) "2017-02-16 13:22:32+01"
["modified"]=>
string(22) "2017-02-16 13:22:32+01"
["deleted"]=>
int(0)
["additional_email"]=>
string(17) "UDIHAS#HFSDKFH.OK"
["description"]=>
string(4) "OPIS"
["displayName"]=>
string(15) "STEFAN ŚMIAŁY"
}
["Duty"]=>
array(3) {
["id"]=>
int(28)
["nazwa"]=>
string(20) "KOORDYNATOR RECEPCJI"
["atrybut"]=>
string(1) "W"
}
["ObjectType"]=>
array(3) {
["id"]=>
int(2)
["nazwa"]=>
string(4) "Obks"
["model"]=>
string(3) "Obk"
}
["Cro"]=>
array(12) {
["id"]=>
NULL
["created"]=>
NULL
["nazwa"]=>
NULL
["tel"]=>
NULL
["fax"]=>
NULL
["email"]=>
NULL
["www"]=>
NULL
["modified"]=>
NULL
["deleted"]=>
NULL
["cro_type_id"]=>
NULL
["displayName"]=>
NULL
["objectTypeIdWithId"]=>
NULL
}
["Attachment"]=>
array(0) {
}
["Specialization"]=>
array(0) {
}
["Obk"]=>
array(1) {
[0]=>
array(13) {
["id"]=>
int(2)
["nazwa"]=>
string(10) "OBK Z ID 2"
["tel"]=>
string(13) "+48 123456890"
["fax"]=>
string(13) "+48 123456789"
["email"]=>
string(15) "EMAIL#EMAIL.COM"
["www"]=>
string(11) "WWW.WWW.WWW"
["modified"]=>
string(22) "2017-03-20 15:11:31+01"
["created"]=>
string(22) "2014-05-12 21:50:17+02"
["deleted"]=>
int(0)
["local_order"]=>
int(3)
["displayName"]=>
string(10) "OBK Z ID 2"
["objectTypeIdWithId"]=>
string(3) "2_2"
["PeopleObk"]=>
array(3) {
["id"]=>
int(1)
["person_id"]=>
int(2)
["obk_id"]=>
int(2)
}
}
}
}
[2]=>
array(7) {
["Person"]=>
array(18) {
["id"]=>
int(3)
["imie"]=>
string(5) "KAMIL"
["nazwisko"]=>
string(10) "STEFAŃSKI"
["tel"]=>
string(13) "+23 123123123"
["mob"]=>
string(13) "+21 412312312"
["email"]=>
string(16) "ASDASD#SDFDSF.LS"
["tytul_naukowy"]=>
string(3) "NIE"
["data_od"]=>
string(10) "2017-02-22"
["data_do"]=>
NULL
["object_id"]=>
int(-1)
["object_type_id"]=>
int(2)
["duty_id"]=>
int(26)
["created"]=>
string(22) "2017-02-22 16:14:32+01"
["modified"]=>
string(22) "2017-02-22 16:14:32+01"
["deleted"]=>
int(0)
["additional_email"]=>
string(22) "ADAM.2313#WEBIMPULS.PL"
["description"]=>
string(4) "TEST"
["displayName"]=>
string(16) "KAMIL STEFAŃSKI"
}
["Duty"]=>
array(3) {
["id"]=>
int(26)
["nazwa"]=>
string(41) "KOORDYNATOR OŚRODKÓW BADAŃ KLINICZNYCH"
["atrybut"]=>
string(1) "W"
}
["ObjectType"]=>
array(3) {
["id"]=>
int(2)
["nazwa"]=>
string(4) "Obks"
["model"]=>
string(3) "Obk"
}
["Cro"]=>
array(12) {
["id"]=>
NULL
["created"]=>
NULL
["nazwa"]=>
NULL
["tel"]=>
NULL
["fax"]=>
NULL
["email"]=>
NULL
["www"]=>
NULL
["modified"]=>
NULL
["deleted"]=>
NULL
["cro_type_id"]=>
NULL
["displayName"]=>
NULL
["objectTypeIdWithId"]=>
NULL
}
["Attachment"]=>
array(0) {
}
["Specialization"]=>
array(0) {
}
["Obk"]=>
array(1) {
[0]=>
array(13) {
["id"]=>
int(3)
["nazwa"]=>
string(10) "OBK Z ID 3"
["tel"]=>
string(13) "+48 123456890"
["fax"]=>
string(13) "+48 123456789"
["email"]=>
string(15) "EMAIL#EMAIL.COM"
["www"]=>
string(11) "WWW.WWW.WWW"
["modified"]=>
string(22) "2017-03-20 10:45:24+01"
["created"]=>
string(22) "2014-05-16 09:09:33+02"
["deleted"]=>
int(0)
["local_order"]=>
int(1)
["displayName"]=>
string(10) "OBK Z ID 3"
["objectTypeIdWithId"]=>
string(3) "2_3"
["PeopleObk"]=>
array(3) {
["id"]=>
int(2)
["person_id"]=>
int(3)
["obk_id"]=>
int(3)
}
}
}
}
And I want just to retrieve Person.id, Person.displayName and Obk.0.id. The two first are no problem, but wheneve I try to get Obk.0.id I'm getting error: SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM for Table Obk.
How can I get something like that? I want to set the value in codition later, but it block my work.

In CakePHP 2 you can specify the fields you want returned by a find() query using the fields option like:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name']
]);
This also works with contained models that have a belongsTo or hasOne relationship:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name', 'Bar.name'],
'contain' => ['Bar']
]);
However, if the contained model is a hasMany or HABTM relationship you need to specify the fields of that model on the contain:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name'],
'contain' => [
'Bar' => ['fields' => 'Bar.name']
]
]);
This is because CakePHP will be performing multiple SQL queries, so the contain needs to have the parameters for the query being run for the relevant model.

Related

Php get from array

I have small problem, I can't get info from an array.
This is outcome when I var_dump variable.
array(1) {
["server"]=> array(34) {
["dedicated"]=> string(1) "d"
["game_descr"]=> string(14) "Counter-Strike"
["game_dir"]=> string(7) "cstrike"
["gq_address"]=> string(13) "185.119.89.91"
["gq_dedicated"]=> string(1) "d"
["gq_gametype"]=> string(14) "Counter-Strike"
["gq_hostname"]=> string(26) "Assassin'S CSDM [de_dust2]"
["gq_joinlink"]=> string(36) "steam://connect/185.119.89.91:27031/"
["gq_mapname"]=> string(8) "de_dust2"
["gq_maxplayers"]=> int(32)
["gq_mod"]=> string(7) "cstrike"
["gq_name"]=> string(18) "Counter-Strike 1.6"
["gq_numplayers"]=> int(32)
["gq_online"]=> bool(true)
["gq_password"]=> int(0)
["gq_port_client"]=> int(27031)
["gq_port_query"]=> int(27031)
["gq_protocol"]=> string(6) "source"
["gq_transport"]=> string(3) "udp"
["gq_type"]=> string(4) "cs16"
["hostname"]=> string(26) "Assassin'S CSDM [de_dust2]"
["map"]=> string(8) "de_dust2"
["max_players"]=> int(32)
["num_bots"]=> int(0)
["num_players"]=> int(32)
["os"]=> string(1) "l"
["password"]=> int(0)
["players"]=> array(0) { }
["port"]=> int(27031)
["protocol"]=> int(48)
["secure"]=> int(1)
["steamappid"]=> int(10)
["teams"]=> array(0) { }
["version"]=> string(13) "1.1.2.7/Stdio"
}
}
How to get hostname for example?
I tried like $info['hostname'], $info[0]['hostname']; But nothing works, why?
array(1) { ... }
The array has one thing in it.
["server"]=> array(34) { ... }
… which is another array with 34 things in it.
You are ignoring the outer array. You need to get the inner array and then access the item you want from that.
$info['server']['hostname']

How to get specific Array value from an Array in Laravel

I'd like to get a specific array data from an array I've get from this code :
$user = $request->instance()->query('user');
var_dump($user);exit;
And the result is :
array(1) { ["user"]=> object(App\Models\User)#332 (27) {
["fillable":protected]=> array(5) { [0]=> string(4) "name" [1]=>
string(8) "username" [2]=> string(5) "email" [3]=> string(8)
"password" [4]=> string(5) "token" } ["hidden":protected]=> array(2) {
[0]=> string(8) "password" [1]=> string(14) "remember_token" }
["casts":protected]=> array(1) { ["email_verified_at"]=> string(8)
"datetime" } ["connection":protected]=> string(5) "mysql"
["table":protected]=> string(5) "users" ["primaryKey":protected]=>
string(2) "id" ["keyType":protected]=> string(3) "int"
["incrementing"]=> bool(true) ["with":protected]=> array(0) { }
["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15)
["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false)
["attributes":protected]=> array(15) { ["id"]=> int(3) ["name"]=>
string(14) "Manchesteriyah" ["username"]=> string(14) "manchesteriyah"
["email"]=> string(24) "manchesteriyah#gmail.com" ["facebook"]=>
string(37) "https://web.facebook.com/xkionna" ["phone"]=> NULL
["email_verified_at"]=> NULL ["password"]=> string(60)
"$2y$10$IrqHE1JfyH0bJ0XD/Hjy.efLg95y/buTIir0PuXcOqDb1yCSS69Oe"
["image"]=> NULL ["description"]=> NULL ["role"]=> string(1) "1"
["token"]=> string(20) "ymsJxEtFnxdPBWYwlYFw" ["member_expiration"]=>
string(19) "2019-07-08 20:33:29" ["created_at"]=> string(19)
"2019-06-08 20:30:25" ["updated_at"]=> string(19) "2019-06-08
20:33:29" } ["original":protected]=> array(15) { ["id"]=> int(3)
["name"]=> string(14) "Manchesteriyah" ["username"]=> string(14)
"manchesteriyah" ["email"]=> string(24) "manchesteriyah#gmail.com"
["facebook"]=> string(37) "https://web.facebook.com/xkionna"
["phone"]=> NULL ["email_verified_at"]=> NULL ["password"]=>
string(60)
"$2y$10$IrqHE1JfyH0bJ0XD/Hjy.efLg95y/buTIir0PuXcOqDb1yCSS69Oe"
["image"]=> NULL ["description"]=> NULL ["role"]=> string(1) "1"
["token"]=> string(20) "ymsJxEtFnxdPBWYwlYFw" ["member_expiration"]=>
string(19) "2019-07-08 20:33:29" ["created_at"]=> string(19)
"2019-06-08 20:30:25" ["updated_at"]=> string(19) "2019-06-08
20:33:29" } ["changes":protected]=> array(0) { } ["dates":protected]=>
array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=>
array(0) { } ["dispatchesEvents":protected]=> array(0) { }
["observables":protected]=> array(0) { } ["relations":protected]=>
array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=>
bool(true) ["visible":protected]=> array(0) { }
["guarded":protected]=> array(1) { [0]=> string(1) "*" }
["rememberTokenName":protected]=> string(14) "remember_token" } }
What I'd like to get is the username value, I've tried some solution like this :
$user->username
but it give me error like this :
Trying to get property 'username' of non-object
How to fix this? Thanks for attention.
The $user variable seems to be holding an array containing 1 element, not the User itself. You must first retrieve the User object from the array and then access the username attribute.
$user = $request->instance()->query('user')['user'];
var_dump($user->username); exit;

How do I parse out this object/array in php?

I have an object I need to parse out and insert into SQL but I am having a hard time figuring out what I need to do as far as the order of fields in the syntax listed below.
Here is the object vardump:
object(EmailCheck\Object\ResponseObject)#25 (1) {
["response":protected]=> array(6) {
["status"]=> string(7) "success"
["total_results"]=> int(6)
["total_pages"]=> int(1)
["query"]=> array(8) {
["job_id"]=> int(2562625)
["valids"]=> int(1)
["invalids"]=> int(1)
["disposables"]=> int(1)
["catchalls"]=> int(1)
["unknowns"]=> int(1)
["page"]=> int(0)
["items_per_page"]=> int(10)
}
["results"]=> array(6) {
[0]=> array(2) {
["data"]=> array(4) {
["email"]=> string(20) "chris#example.com"
[0]=> string(1) "1"
["ID"]=> string(1) "1"
["EMAIL"]=> string(20) "chris#example.com"
}
["verification"]=> object(EmailCheck\Object\VerificationObject)#7 (1) {
["response":protected]=> array(7) {
["result"]=> string(5) "valid"
["flags"]=> array(3) {
[0]=> string(7) "has_dns"
[1]=> string(10) "has_dns_mx"
[2]=> string(16) "smtp_connectable"
}
["suggested_correction"]=> string(0) ""
["address_info"]=> object(EmailCheck\Object\ResponseObject)#9 (1) {
["response":protected]=> array(9) {
["original_email"]=> string(20) "chris#example.com"
["normalized_email"]=> string(20) "chris#example.com"
["addr"]=> string(6) "chris"
["alias"]=> string(0) "" ["host"]=> string(13) "example.com"
["fqdn"]=> string(13) "example.com"
["domain"]=> string(9) "example"
["subdomain"]=> string(0) ""
["tld"]=> string(3) "com"
}
}
["email"]=> string(20) "chris#example.com
["result_integer"]=> int(0)
["credits_info"]=> object(EmailCheck\Object\ResponseObject)#8 (1) {
["response":protected]=> array(0) {
}
}
}
}
}
I know the syntax is something like this but it is not returning anything:
echo $object->data->email;
I need to extract the following fields: result, normalized_email, email
This is what ended up working. I did not need to reference the "response" portion of the object.
$object->results[0]['data']['email']

Filtering and limiting API data in array

I'm using tmdb.org's API to retrieve movie data. Their credits are returned as a separate response, though. I want to be able to display only the Director and the first 10 cast members. How would I manipulated that data in the a JSON response?
Here is an excerpt of what is returned. I removed a lot of the credits so that it's not so long.
array(26) {
["adult"]=>
bool(false)
["backdrop_path"]=>
string(32) "/4iJfYYoQzZcONB9hNzg0J0wWyPH.jpg"
["belongs_to_collection"]=>
array(4) {
["id"]=>
int(10)
["name"]=>
string(20) "Star Wars Collection"
["poster_path"]=>
string(31) "/ghd5zOQnDaDW1mxO7R5fXXpZMu.jpg"
["backdrop_path"]=>
string(32) "/d8duYyyC9J5T825Hg7grmaabfxQ.jpg"
}
["budget"]=>
int(11000000)
["genres"]=>
array(3) {
[0]=>
array(2) {
["id"]=>
int(12)
["name"]=>
string(9) "Adventure"
}
[1]=>
array(2) {
["id"]=>
int(28)
["name"]=>
string(6) "Action"
}
[2]=>
array(2) {
["id"]=>
int(878)
["name"]=>
string(15) "Science Fiction"
}
}
["homepage"]=>
string(61) "http://www.starwars.com/films/star-wars-episode-iv-a-new-hope"
["id"]=>
int(11)
["imdb_id"]=>
string(9) "tt0076759"
["original_language"]=>
string(2) "en"
["original_title"]=>
string(9) "Star Wars"
["overview"]=>
string(312) "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire."
["popularity"]=>
float(9.414021)
["poster_path"]=>
string(32) "/tvSlBzAdRE29bZe5yYWrJ2ds137.jpg"
["production_companies"]=>
array(2) {
[0]=>
array(2) {
["name"]=>
string(9) "Lucasfilm"
["id"]=>
int(1)
}
[1]=>
array(2) {
["name"]=>
string(38) "Twentieth Century Fox Film Corporation"
["id"]=>
int(306)
}
}
["production_countries"]=>
array(1) {
[0]=>
array(2) {
["iso_3166_1"]=>
string(2) "US"
["name"]=>
string(24) "United States of America"
}
}
["release_date"]=>
string(10) "1977-03-20"
["revenue"]=>
int(775398007)
["runtime"]=>
int(121)
["spoken_languages"]=>
array(1) {
[0]=>
array(2) {
["iso_639_1"]=>
string(2) "en"
["name"]=>
string(7) "English"
}
}
["status"]=>
string(8) "Released"
["tagline"]=>
string(44) "A long time ago in a galaxy far, far away..."
["title"]=>
string(9) "Star Wars"
["video"]=>
bool(false)
["vote_average"]=>
float(7.9)
["vote_count"]=>
int(4584)
["credits"]=>
array(2) {
["cast"]=>
array(106) {
[0]=>
array(7) {
["cast_id"]=>
int(3)
["character"]=>
string(14) "Luke Skywalker"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000441"
["id"]=>
int(2)
["name"]=>
string(11) "Mark Hamill"
["order"]=>
int(0)
["profile_path"]=>
string(32) "/ws544EgE5POxGJqq9LUfhnDrHtV.jpg"
}
[1]=>
array(7) {
["cast_id"]=>
int(4)
["character"]=>
string(8) "Han Solo"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000445"
["id"]=>
int(3)
["name"]=>
string(13) "Harrison Ford"
["order"]=>
int(1)
["profile_path"]=>
string(32) "/aVKNqtkzZCymupOrvwxozamRyVc.jpg"
}
[2]=>
array(7) {
["cast_id"]=>
int(5)
["character"]=>
string(20) "Princess Leia Organa"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000449"
["id"]=>
int(4)
["name"]=>
string(13) "Carrie Fisher"
["order"]=>
int(2)
["profile_path"]=>
string(32) "/pbleNurCYdrLFQMEnlQB2nkOR1O.jpg"
}
[3]=>
array(7) {
["cast_id"]=>
int(6)
["character"]=>
string(17) "Grand Moff Tarkin"
["credit_id"]=>
string(24) "52fe420dc3a36847f800044d"
["id"]=>
int(5)
["name"]=>
string(13) "Peter Cushing"
["order"]=>
int(3)
["profile_path"]=>
string(32) "/fg7ufC0IMr6VasQzzdmTtX5ycQF.jpg"
}
[4]=>
array(7) {
["cast_id"]=>
int(14)
["character"]=>
string(20) "Obi-Wan "Ben" Kenobi"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000477"
["id"]=>
int(12248)
["name"]=>
string(13) "Alec Guinness"
["order"]=>
int(4)
["profile_path"]=>
string(32) "/89QNJ7u1hNaCglkotmZEbwCNp1M.jpg"
}
[5]=>
array(7) {
["cast_id"]=>
int(7)
["character"]=>
string(20) "See Threepio (C-3PO)"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000451"
["id"]=>
int(6)
["name"]=>
string(15) "Anthony Daniels"
["order"]=>
int(5)
["profile_path"]=>
string(32) "/cljvryjb3VwTsNR7fjQKjNPMaBB.jpg"
}
[6]=>
array(7) {
["cast_id"]=>
int(8)
["character"]=>
string(19) "Artoo-Detoo (R2-D2)"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000455"
["id"]=>
int(130)
["name"]=>
string(11) "Kenny Baker"
["order"]=>
int(6)
["profile_path"]=>
string(32) "/sdd9rgifNF9C51RejG7sUGU8Bka.jpg"
}
[7]=>
array(7) {
["cast_id"]=>
int(15)
["character"]=>
string(9) "Chewbacca"
["credit_id"]=>
string(24) "52fe420dc3a36847f800047b"
["id"]=>
int(24343)
["name"]=>
string(12) "Peter Mayhew"
["order"]=>
int(7)
["profile_path"]=>
string(32) "/din1s5H4C4CfcnkHfEeRcdFlsVj.jpg"
}
[8]=>
array(7) {
["cast_id"]=>
int(16)
["character"]=>
string(11) "Darth Vader"
["credit_id"]=>
string(24) "52fe420dc3a36847f800047f"
["id"]=>
int(24342)
["name"]=>
string(12) "David Prowse"
["order"]=>
int(8)
["profile_path"]=>
string(32) "/cJtmBVrjYwawh2cCiAfZkEjPeqc.jpg"
}
[9]=>
array(7) {
["cast_id"]=>
int(17)
["character"]=>
string(28) "Voice of Darth Vader (voice)"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000483"
["id"]=>
int(15152)
["name"]=>
string(16) "James Earl Jones"
["order"]=>
int(9)
["profile_path"]=>
string(32) "/2ZuBf3ip2RXhkiQqGUjbUzAf4Nx.jpg"
}
[10]=>
array(7) {
["cast_id"]=>
int(18)
["character"]=>
string(10) "Uncle Owen"
["credit_id"]=>
string(24) "52fe420dc3a36847f8000487"
["id"]=>
int(33032)
["name"]=>
string(10) "Phil Brown"
["order"]=>
int(10)
["profile_path"]=>
string(32) "/exkyN66HiZWJDmpcOza2hWoswOo.jpg"
}
[11]=>
array(7) {
["cast_id"]=>
int(19)
["character"]=>
string(9) "Aunt Beru"
["credit_id"]=>
string(24) "52fe420dc3a36847f800048b"
["id"]=>
int(131625)
["name"]=>
string(14) "Shelagh Fraser"
["order"]=>
int(11)
["profile_path"]=>
string(32) "/xNfiibBvknHztEnL0g7dcdrxOKq.jpg"
}
[12]=>
array(7) {
["cast_id"]=>
int(24)
["character"]=>
string(10) "Chief Jawa"
["credit_id"]=>
string(24) "52fe420dc3a36847f800049f"
["id"]=>
int(132538)
["name"]=>
string(11) "Jack Purvis"
["order"]=>
int(12)
["profile_path"]=>
string(32) "/tuFTY1jhlEgZm3vM80KdAEvHwNI.jpg"
}
int(1)
["job"]=>
string(8) "Director"
["name"]=>
string(12) "George Lucas"
["profile_path"]=>
string(32) "/8qxin8urtFE0NqaZNFWOuV537bH.jpg"
}
[1]=>
array(6) {
["credit_id"]=>
string(24) "562e75309251414006009955"
["department"]=>
string(7) "Writing"
["id"]=>
int(1)
["job"]=>
string(6) "Writer"
["name"]=>
string(12) "George Lucas"
["profile_path"]=>
string(32) "/8qxin8urtFE0NqaZNFWOuV537bH.jpg"
}
So, from the above, I want to able to display the data in the main array and then for the appended data, I'd like it to display like:
Director: George Lucas
Cast: Carrie Fisher, Mark Hammill, Harrison Ford [and then 7 more]
I'm new to fetching API data. So any help on this would be much appreciated.

getting data from array within an object [duplicate]

I'm new to PHP and am trying to access the value of "contactId" from the following:
object(stdClass)#2 (4) {
["contacts"]=> array(1) {
[0]=> object(stdClass)#3 (18) {
["email"]=> string(24) "joewilliams#icontact.com"
["firstName"]=> string(3) "Joe"
["lastName"]=> string(8) "Williams"
["prefix"]=> string(3) "Mr."
["suffix"]=> string(3) "Jr."
["fax"]=> string(0) ""
["phone"]=> string(10) "8668039462"
["street"]=> string(21) "2365 Meridian Parkway"
["street2"]=> string(0) ""
["city"]=> string(6) "Durham"
["state"]=> string(2) "NC"
["postalCode"]=> string(5) "27713"
["createDate"]=> string(19) "2013-03-30 21:22:28"
["status"]=> string(6) "normal"
["bounceCount"]=> NULL
["contactId"]=> string(8) "67295434"
}
}
["limit"]=> int(20)
["offset"]=> int(0)
["total"]=> int(1)
}
How can I retrieve the value of contactId?
Many thanks!
These are not arrays, but an object containing an array containing an object. PHP object access syntax is with ->
$variableName->contacts[0]->contactId

Categories