ninedoors Posted April 23, 2008 Share Posted April 23, 2008 Is there a simple way to replace a value in an array if I have the key value? So I have: Array('a' => 345, 'b' => 343439, 'c' => 529) and I know the element key I want to replace. Lets say 'b'. Is there a way fro me to replace 343439 with 5679? Thanks Link to comment https://forums.phpfreaks.com/topic/102575-solved-replace-a-value-in-an-array/ Share on other sites More sharing options...
p2grace Posted April 23, 2008 Share Posted April 23, 2008 $arr['b'] = 5679; Link to comment https://forums.phpfreaks.com/topic/102575-solved-replace-a-value-in-an-array/#findComment-525233 Share on other sites More sharing options...
ninedoors Posted April 23, 2008 Author Share Posted April 23, 2008 Wow am I stupid. I thought I had tried that but somehow messed it up by putting arr[] = 5679['b']; HAHAHAHA. Thanks p2grace Link to comment https://forums.phpfreaks.com/topic/102575-solved-replace-a-value-in-an-array/#findComment-525243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.