Jump to content

Can't get array_walk to show changes to array.


Jessica

Recommended Posts

I have tried both:

array_walk(&$files, 'htmlentities');
array_walk($files, 'htmlentities');

 

Using PHP5

 

Nothing changes, it still prints & instead of &

Do I have to wrap htmlentities in a in a custom function or am I doing something wrong?

 

EDIT:

I tried wrapping it in a function and no change.

$h = create_function('$txt', 'return htmlentities($txt);');
array_walk(&$files, $h);
print_r($files);

 

Array

(

    [28] => panels/DC_air & space #2.jpg

    [29] => panels/DC_air & space #3.jpg

    [30] => panels/DC_air & space.jpg

)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.