List Info

Thread: note 79006 added to function.utf8-encode




note 79006 added to function.utf8-encode
user name
2007-11-06 19:42:35
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/79006
Del: integrated  -- h
ttps://master.php.net/note/delete/79006/integrated
Del: useless     -- http
s://master.php.net/note/delete/79006/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/79006/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/79006/spam
Del: non-english -- 
https://master.php.net/note/delete/79006/non-english
Del: in docs     -- http
s://master.php.net/note/delete/79006/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/79006
Reject      -- https://mast
er.php.net/note/reject/79006
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


note 79006 deleted from function.utf8-encode by ezyang
user name
2007-11-06 20:21:31
Note Submitter: ethan dot nelson at ltd dot org
Reason: bad code

----

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);
      }

    }

  }

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


[1-2]

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