chuco08 Posted July 21, 2009 Share Posted July 21, 2009 So I am attempting to write a little PHP app that will store my passwords to various sites. It's pretty basic stuff just a way to continue progressing with my PHP skills. I am admittedly stuck with my current objective which would have all websites be echoed out into my table as click able links. Basically my data is stored in a mysql table which I pull out into an array as follows: array([id] => 1, [name] => joe.user, [site] => myspace.com) array([id] => 2, [name] => joe.user, [site] => facebook.com) This list will grow obviously as I begin to populate data in it. Currently I have been trying to play with array_map function and have been successfully been able to turn every item in the array into a clickable link. My questions would be, how would I only mainpulate the array['site] value while leaving everything else alone at least for now. Is array_map the way to go or maybe a foreach loop would be best. Please help? Link to comment https://forums.phpfreaks.com/topic/166863-array_map-maybe-help-please/ Share on other sites More sharing options...
Bendude14 Posted July 22, 2009 Share Posted July 22, 2009 if your array was called $info then simply use $info['site'] = "myspace.com"; Since you have an array of sites you can use the array index first like so $info[0]['site']; Remeber arrays start from 0 so this would be your first array. Link to comment https://forums.phpfreaks.com/topic/166863-array_map-maybe-help-please/#findComment-879983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.