i am trying to figure out how to get a new variable as mix of other variables. Below code: $results = array("a","b","c","d"); shuffle($results); foreach ($results as $result) { echo "$result"; } Code (markup): outputs sth like: dbca and i would like to make a variable $sth = dbca so how can i write sth like $sth = foreach ($results as $result) { echo "$result";} thanks for your help! I am still learning php.
this is same he posted $results = array("a","b","c","d"); shuffle($results); foreach ($results as $result) { $sth .= $result; } PHP: and you're done