Skip to content
Advertisement

Tag: jagged-arrays

create a PHP function that works for simple arrays and nested arrays

I am trying to create a function that works on both simple arrays and nested arrays. So far, the function looks like this: It works fine for simple arrays – for example: But it fails with the message “Warning: htmlspecialchars() expects parameter 1 to be string, array given…” for nested arrays – for example: What modifications should be made to

Advertisement