I am doing an address lookup on a remote server. I have the result put into a multi-dimensional array ($result).
If there is no results from the search print_r($result) displays:
Array
(
[searchResults] =>
)
If one result is returned print_r($result) displays:
Array
(
[searchResults] => Array
(
[ArrayOfString] => Array
(
[0] => Array
(
[string] => Array
(
[0] => 11101 WEST 580 SOUTH STREET
[1] =>
[2] => OREM
[3] => UT
[4] => 84458
[5] => STATUS
)
)
)
)
)
If more than one result is return print_r($result) returns:
Array
(
[searchResults] => Array
(
[ArrayOfString] => Array
(
[0] => Array
(
[string] => Array
(
[0] => 11101 WEST 580 SOUTH STREET
[1] =>
[2] => OREM
[3] => UT
[4] => 84458
[5] => STATUS
)
)
[1] => Array
(
[string] => Array
(
[0] => 11101 WEST 580 SOUTHWEST STREET
[1] =>
[2] => OREM
[3] => UT
[4] => 84458
[5] => STATUS
)
)
[2] => Array
(
[string] => Array
(
[0] => 11101 WEST 1580 EAST STREET
[1] =>
[2] => OREM
[3] => UT
[4] => 84458
[5] => STATUS
)
)
[3] => Array
(
[string] => Array
(
[0] => 11101 WEST 5560 NORTH STREET
[1] =>
[2] => OREM
[3] => UT
[4] => 84458
[5] => STATUS
)
)
)
)
)
How can I tell if there are 0, 1 or more than one results returned?
I tried this: count($return[searchResults][ArrayOfString])
but that returns a 1 even if there are no results returned.
What is the most efficient way to tell how many results there are in my array?
Thank You.