[Tutor] Initialize values from a text input file

Tim Johnson tim at johnsons-web.com
Tue Jan 4 03:16:42 CET 2011


* Hugo Arts <hugo.yoshi at gmail.com> [110103 17:12]:
> On Tue, Jan 4, 2011 at 2:06 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> >
> > "Tim Johnson" <tim at johnsons-web.com> wrote
> >
> >>  Now, Alan, do you know anything about PHP? If you do, can you
> >>  comment on the PHP extract() function?
> >
> > I know enough basic PHP to read a page with code in it and get the general
> > drift. I've never written a line of it and have learned enough about it that
> > I don't want to! :-)
> >
> > Now as for extract() - it doesn't appear in my Teach Yourself PHP book, so
> > nope, I've no idea what it does, I'd need to look it up.
> > And I'm way too lazy, and it's way too late to do that! :-)
> >
> 
> extract takes an array and merges it with the local symbol table.
> Essentially the same thing locals() would do if it was actually
> writable everywhere (as Steven points out it isn't).
> 
> If you ask me, this is an insanely bad idea and I have not a clue as
> to why you'd actually want to do this, rather than just work with the
> array.
  I've decided that members of my company (and I punished myself by
  appointing myself) had to learn a little PHP. At least enough to
  persuade a potential client why python would be a better choice.
  I would consider extract() one of those potent arguments as to why to
  use python....
  thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com


More information about the Tutor mailing list