Re: function into string

From: Date: Tue, 07 Aug 2001 12:44:12 +0000
Subject: Re: function into string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61599@lists.php.net to get a copy of this message
On Tue, Aug 07, 2001 at 02:30:31PM +0200, Veniamin Goldin wrote: > Sorry for the dummies question, but how do I insert into string like: > > echo "balalala" > > how to insert function in the midle like : > echo "balalala [trim(odbc_result($result_id,3))] aasasasas" > > > Thank you. > How about: echo "balalala ".trim(odbc_result($result_id,3))." aasasasas"; or echo "balalala [".trim(odbc_result($result_id,3))."] aasasasas"; depending on what you meant by the '[' and ']'. This is just one of many possible ways of doing it. I, myself, am not to happy with echo(). Don't ask me why, just a feeling... No return value and stuff. I prefer using real functions that I can check on being successful. So how about: print ("balalala [".trim(odbc_result($result_id,3))."] aasasasas"); or printf ("balalala [%s] aasasasas", trim(odbc_result($result_id,3))); Well... as I said, many possibilities... -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#61599) next »