Re: Syntax Snag need extra eyes (RESOLVED)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Miller, Terion wrote:
> Thanks Jim!! I did read the manual and don't get it, like why is printf used and not echo...how do you decided which to use?
> 
> 
> 
> On 7/16/09 11:25 AM, "Jim Lucas" <lists@xxxxxxxxx> wrote:
> 
> printf(
>         '<a href="view.php?name=%s"><b>%s</b><br />%s<br /><br /></a>',
>         $row['name'],
>         $row['name'],
>         $row['address']
> );
> 

I would say personal preference is the main factor.

I use echo mostly.  Some people like print() and some line printf() &
sprintf().  Probably depends mostly on where you learned to program.

Honestly, echo and print() use the same internal PHP construct.  From
what I understand, one links to the other as an alias or something to
that affect.  Also, the parenthesis are optional when using echo and print.

Back in the day, to be consistent, most people used printf() in C or
other similar programming languages.

Jim Lucas


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux