Re: "x" as a multiplier

From: Date: Tue, 03 Dec 2002 23:04:43 +0000
Subject: Re: "x" as a multiplier
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126907@lists.php.net to get a copy of this message
At 23:20 03.12.2002, John Meyer said: --------------------[snip]-------------------- >Code: > >$newwidth . "x" . $newheight > > >What I want to get out is a string, like 89x115. All I am getting though, >is one number, even though if I do this > >$newwidth . " x " . $newheight > >It prints out just fine. What is going on here? --------------------[snip]-------------------- Not sure what you mean here, you say you only get one number, but "it prints out fine"? However, this gives exactly what you want: --------------------<code>-------------------- <pre><?php $a = 1024; $b = 768; $s = $a . 'x' . $b; // create a string echo $s; echo "\n{$a}x{$b}\n"; // or print it directly ?> </pre> --------------------</code>-------------------- Output for both cases: 1024x768 1024x768 -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#126907) next »