Shannon,
But I can't quite figure out, once I know that my value is in that array, of
how to update that particular array element and/or add a new element to
that array at that index.
In PHP, arrays do not have to use numeric indexes; instead the arrays are
"associative" and you can use strings (or numbers) as an array index. This
is actually very powerful, and something I learned to love in AWK back in
the early 90's. Anyway, you don't "add a new element to that array *at that
index*" (emphasis mine). You can add an element, change the value of an
element, or remove an element at will.
Using your variable names, to update the value of the index located:
$theArrayToSearch[ $found ] = "new value";
To add a new element with some new index:
$theArrayToSearch[ 'some new index' ] = "some value";
To remove an element from an array:
unset( $theArrayToSearch[ $found ] );
Within the square brackets can be a variable name, constant, or expression,
but the resulting value will be the array index. It does not have to be a
number; it can be a string.
Multi-dimension arrays just need multiple sets of square brackets, like
$array[ $dim1 ][ $dim2 ][ $dim3 ] = value;
As an Amazon Associate we earn from qualifying purchases.