How to manipulate an array element of a specific key name
For example, I have an array taken out of the database, the key name is the field name
Output this array element directly to the table. I'll just use foreach.
But I want to add hyperlinks for all elements of a particular key name, such as all array elements with the key name ' UserID '
And then output it on the table.
Is there a way?
Share to:
------Solution--------------------
Not the same, you add the link when you output it.
------Solution--------------------
foreach ($arr as $key = = $value) {
if ($key = = "UserID") {
echo "". $key. "";
}
}
------Solution--------------------
Do you have this code that doesn't have syntax errors, doesn't show up, or doesn't show what you're looking for?
------Solution--------------------
Very simple, such as the array you read in the $row, then
$row [' userid '] = "$row [userid]";
And then foreach.
------Solution--------------------
foreach ($arr as $v) {
echo "'". $v [' userid ']. "'";
}