Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array
- (
- [0] => Array
- (
- [background] => https://example.com/image.jpg
- [description] => Example text
- [url] => https://example.com
- )
- [1] => Array
- (
- [background] => https://example.com/image.jpg
- [description] => Example text
- [url] => https://example.com
- )
- )
- $array = append_field($array, 'url', '?parameter=test');
- function append_field($array, $field, $parameter)
- {
- foreach ($array as $inner_array) :
- foreach ($inner_array as $key => $append) :
- if ($key == $field) :
- $append .= $parameter;
- endif;
- endforeach;
- endforeach;
- return $array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement