|
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
--
This is the PC Technical Discussion for iSeries Users (PcTech) mailing list
To post a message email: PcTech@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/pctech
or email: PcTech-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/pctech.
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.