Re: prepending concatenating assignment operator

From: Date: Sun, 26 Jul 2009 05:04:11 +0000
Subject: Re: prepending concatenating assignment operator
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-295838@lists.php.net to get a copy of this message
On Fri, Jul 24, 2009 at 8:53 PM, Daniel Kolbo<kolb0057@umn.edu> wrote: > Hello, > > I know the appending concatenating assignment operator: > $str_name = "Foobar"; > $str_name .= " Sr"; > echo $str_name;//Foobar Sr > > But is there a shortcut assignment operator for prepending concatenation? > > $str_name = "Foobar"; > //$str_name =. "Mr "; > // i know this is not allowed, but is there some shorcut? > $str_name = "Mr " . $str_name; > echo $str_name;//Mr Foobar > > Just curious. > > Thanks, > dK > ` No, there is not a "prepend" concatenation operator. http://www.php.net/manual/en/language.operators.string.php

« previous php.general (#295838) next »