So this is driving me crazy trying to figure out the syntax.
Very probably I'm overthinking it and making it harder than it needs to be
but.
In RPG, it's really easy to find an element in an array based on some value,
and then to update that array element at the found index.
If myArray(idx) = "T"
Eval myArray(idx) = "F";
Endif;
But how do I do that in PHP?
I can search for a value in an array using in_array:
$found = in_array($myValueToSearchFor, $theArrayToSearch)
If($found)
{
}
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.
Shannon O'Donnell
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.