Jay Blanchard wrote:
Howdy all!
Here is hoping that Friday is just another day in paradise for everyone.
I have an array, a multi-dimensional array. I need to either
a. loop through it and recognize when I have com upon a new sub-array so
that I can do 'new' output
2. OR get each of the sub-ar
If you need to backtrack from the lat/long to the "H" key, why not build a
reverse lookup array?
$arr[$lat . ":" . $long] = $hvalue;
?
-TG
= = = Original message = = =
[snip]
> a. loop through it and recognize when I have com upon a new sub-array so
> that I can do 'new' output
> 2. OR get ea
Yeah.. or something like this! (Chris' looks better than mine.. maybe his
brain's working at 70% today :)
-TG
= = = Original message = = =
> a. loop through it and recognize when I have com upon a new sub-array so
> that I can do 'new' output
> 2. OR get each of the sub-arrays out as individua
[snip]
I'm guessing you wouldn't ask this, Jay, unless there was an issue with
not knowing the depth of the data.
[/snip]
Exactly. I have another department that sends the data as text files and
I knew that I could send them to a database and all would be well, or
relatively so. But that adds a la
Yeah, that foreach is outright printing the arrays (foreach $parent... print
$parent?)
I'm guessing you wouldn't ask this, Jay, unless there was an issue with not
knowing the depth of the data.
I saw something once with doing recursive function calls to dig down into an
array or something. S
[snip]
> a. loop through it and recognize when I have com upon a new sub-array so
> that I can do 'new' output
> 2. OR get each of the sub-arrays out as individual arrays.
This might help get you going in the right direction...
function print_elements( $var ) {
if( is_array( $var )) {
> a. loop through it and recognize when I have com upon a new sub-array so
> that I can do 'new' output
> 2. OR get each of the sub-arrays out as individual arrays.
This might help get you going in the right direction...
function print_elements( $var ) {
if( is_array( $var )) {
fore
[snip]
that's a dump of the arraycan you paste the source?
[/snip]
Not really. The original array was manipulated to get the point (H)
groups together for the new array so that I could break the points back
out together (they are not together in the original file). Here is how I
got there
that's a dump of the arraycan you paste the source?
On 3/31/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> can you paste the array you're using?
> [/snip]
>
> It was in the original post.
>
> Array
> (
> [H7] => Array
> (
> [0] => Array
> (
[snip]
can you paste the array you're using?
[/snip]
It was in the original post.
Array
(
[H7] => Array
(
[0] => Array
(
[lon] => -99.2588
[lat] => 29.1918
)
[1] => Array
can you paste the array you're using?
On 3/31/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> foreach ($parent as $child)
> {
> print $parent;
>
> foreach ($child as $item) {
> print $child . "=" . $item;
> }
>
> }
>
> didn't test it, but this should work.
> [/snip]
[snip]
foreach ($parent as $child)
{
print $parent;
foreach ($child as $item) {
print $child . "=" . $item;
}
}
didn't test it, but this should work.
[/snip]
Didn't work, returns ArrayArray=ArrayArrayArray=ArrayArray=Array
--
PHP General Mailing List (http://www.php.net
foreach ($parent as $child)
{
print $parent;
foreach ($child as $item) {
print $child . "=" . $item;
}
}
didn't test it, but this should work.
On 3/31/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> Howdy all!
>
> Here is hoping that Friday is just another day in paradis
Howdy all!
Here is hoping that Friday is just another day in paradise for everyone.
I have an array, a multi-dimensional array. I need to either
a. loop through it and recognize when I have com upon a new sub-array so
that I can do 'new' output
2. OR get each of the sub-arrays out as individual
14 matches
Mail list logo