I have some items in an array which need to be written to out-printer, one per line. Â Easy enough while they’re still in an array, Â but I need to list them in the middle of some other text, but still showing each on its own line. For simplicity’s sake, below is an example:
$test = 'red', 'blue', 'yellow' $myString = "These are colors: $test"
This yields: Â These are colors: red blue yellow
How can I get it to yield:
These are colors:
?? I’m sure there’s an easy way to do this. Â I understand that it’s due to the fact that I’m forcing the array contents into a string, but I’ve tried a few ways of inserting
nr, but nothing I’ve tried works. Also my search-fu didn’t yield any solutions to the problem.