Re: Glue together variable and string



On Tue, 28 Feb 2006 20:38:00 -0000, Krustov <krusty@xxxxxxxxxxxxxxxxxxxxx>
wrote:

<comp.lang.php , , helgefredheim@xxxxxxxxx>
<1141158879.329609.168420@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
<28 Feb 2006 12:34:39 -0800>

$suffix = "px";

$height = 14;

I need to print "14px" widthout any whitespace inbetween 14 and px. How

$thc="$suffix" . "$height";

The double-quotes are pointless here, but otherwise correct.

If you wanted to use double quotes, an alternative is:

$thc = "$suffix$height";

The OP should read: http://uk.php.net/manual/en/language.types.string.php

--
Andy Hassall :: andy@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.



Relevant Pages

  • Re: Glue together variable and string
    ... The double-quotes are pointless here, ... What's the point in self-destructing replies, ... http://www.andyhsoftware.co.uk/space:: disk and FTP usage analysis tool ...
    (comp.lang.php)
  • Re: Glue together variable and string
    ... The double-quotes are pointless here, ... Using double-quotes in that scenario will just increase the parsing time. ... That will make an implicit variable casting of any numeric ... El que las hace, las imagina. ...
    (comp.lang.php)