PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
spacebiscuit
Forum Contributor
Posts: 390 Joined: Mon Mar 07, 2005 3:20 pm
Post
by spacebiscuit » Thu Jan 31, 2013 4:31 am
Hi,
I'm trying to work with an array object, I want to make the data in each index uppercase, I can output the data to screen but how do I change values.
Code: Select all
foreach ($order->delivery as $key => $value) {
print "$key => $value\n";
}
Thank you.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Thu Jan 31, 2013 10:50 am
Code: Select all
foreach ($order->delivery as $key => $value) {
$order->delivery[$key] = strtoupper($value);
}
foreach ($order->delivery as $key => $value) {
print "$key => $value\n";
}
(#10850)
spacebiscuit
Forum Contributor
Posts: 390 Joined: Mon Mar 07, 2005 3:20 pm
Post
by spacebiscuit » Thu Jan 31, 2013 4:45 pm
That's great, worked perfectly - thank you.