NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can't get no $action

David Mintz dmintz at davidmintz.org
Mon Apr 26 13:11:25 EDT 2004


One convenience of echo (over print) in PHP is that you can use commas and
echo as many things as you like -- like the Perl's print. Feel free to
feel confused if you like.

echo "Huh?", $object->method(), "... whatever.";

On Mon, 26 Apr 2004, John Lacey wrote:

>
>
> Adam Maccabee Trachtenberg wrote:
> > On Mon, 26 Apr 2004, Jeff Siegel wrote:
> >
> >
> >>Some of these books have great ideas but make life quite confusing for
> >>the newcomer. Some books use $HTTP_POST_VARS and others use $_POST in
> >>their code. (See note 1 at
> >>http://phundamentals.nyphp.org/PH_bookrecommendations.php). It depends
> >>when they were written. And, as you found out, some assume
> >>register_globals has been turned on.
> >
> >
> > FWIW, "PHP Cookbook" assumes register_globals is Off and always
> > superglobals like $_POST over the $HTTP_POST_VARS equivalent.
>
> The other thing that causes unnecessary hiccups to newcomers is
> the mixed use of "echo" and "print".  It may be a small matter
> to experienced folks, but my rule of thumb on this would be "use
> echo in all cases -- use print only if the code calls for it".
>
> Without getting into the "echo-is-slightly-faster-than-print"
> discussion, the word "echo" makes more sense to me in terms of
> "echoing to a screen/display/browser".
>
> John
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>


---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list