[theme-reviewers] usage of single quotes and double quotes in PHP

Josh Stauffer joshstauffer at gmail.com
Thu Mar 3 14:57:47 UTC 2011


Why printf vs sprintf ?

Josh


On Thu, Mar 3, 2011 at 8:20 AM, Austin Matzko <austin at pressedcode.com>wrote:

> On Thu, Mar 3, 2011 at 8:13 AM, Satish Gandham <satish.iitg at gmail.com>
> wrote:
> > Which is better of the following two
> >
> > <?php
> > echo "This is a string with variable $test_variable"
> > ?>
> >
> > <?php
> > echo 'This is another variant of the above statement '.$test_variable
> > ?>
>
> Better:
>
> printf( __( 'This is another variant of the above statement %s',
> 'theme-slug' ), $test_variable );
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110303/f4da5376/attachment-0001.htm>


More information about the theme-reviewers mailing list