List Info

Thread: note 79005 added to function.utf8-encode




note 79005 added to function.utf8-encode
user name
2007-11-06 19:41:47
This does the same thing as some of the posts below (minus
the keys), but I thought I'd share anyway cause it is
slightly more elegant.  Also, its a good example using
references such that this could be used as a callback
function.

  function utf_prepare(&$array) {

    foreach($array AS $key => &$value) {

      if (is_array($value)) {
        $this->utf_prepare($value);
      } else {
        $value = utf8_encode($value);
      }

    }

  }
----
Server IP: 208.69.120.35
Probable Submitter: 140.211.84.125
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit        -- https://master
.php.net/note/edit/79005
Del: integrated  -- h
ttps://master.php.net/note/delete/79005/integrated
Del: useless     -- http
s://master.php.net/note/delete/79005/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/79005/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/79005/spam
Del: non-english -- 
https://master.php.net/note/delete/79005/non-english
Del: in docs     -- http
s://master.php.net/note/delete/79005/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/79005
Reject      -- https://mast
er.php.net/note/reject/79005
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )