Re: [PHP] How does this code work?

2012-07-03 Thread Robert Williams
On Jul 2, 2012, at 22:15, Jim Lucas li...@cmsws.com wrote: I think you missed something here... The above function uses strtr() not strstr() Wow. I knew there had to be a simple, logical explanation (there was), that it would likely be one of those stupid things that I'd spot in two seconds

Re: [PHP] How does this code work?

2012-07-03 Thread tamouse mailing lists
On Tue, Jul 3, 2012 at 2:31 AM, Robert Williams rewilli...@thesba.com wrote: On Jul 2, 2012, at 22:15, Jim Lucas li...@cmsws.com wrote: Hmm, I wonder if those thirty years are having a different sort of impact on me, in the form of decaying eyesight I've had to tweak up the default fonts

[PHP] How does this code work?

2012-07-02 Thread Robert Williams
I found this code in a user comment in the PHP docs for htmlentities(): ?php function xml_character_encode($string, $trans='') { $trans = (is_array($trans)) ? $trans : get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); foreach ($trans as $k=$v) $trans[$k]= #.ord($k).;; return

Re: [PHP] How does this code work?

2012-07-02 Thread Jim Lucas
On 7/2/2012 7:15 PM, Robert Williams wrote: I found this code in a user comment in the PHP docs for htmlentities(): ?php function xml_character_encode($string, $trans='') { $trans = (is_array($trans)) ? $trans : get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); foreach ($trans as $k=$v)