php - Using concatenating assignment operator for 2 variables same time -


can use.= operator append same argument 2 or more variables @ same time?

like (not working example)

$a = "hello"; $b = "hi";  $a , $b .= " world!";  // $a = "hello world!" , $b = "hi world!" 

you can use:

$items = array('hello', 'hi'); foreach ($items &$item) $item .= ' world!'; var_dump($items); 

or:

$a = "hello"; $b = "hi"; foreach (array('a', 'b') $key) $$key .= ' world'; var_dump($a); var_dump($b); 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -