Currently I'm trying this:

```
$sql_words = array("select","update","set", "from", "where", "and", "order by","insert into","delete");

echo str_replace($sql_words,
         array("<span style='color:red'>SELECT</span>","<span style='color:red'>UPDATE</span>",
          "<span style='color:green'>SET</span>", "<span style='color:green'>FROM</span>",
          "<span style='color:blue'>WHERE</span>","<span style='color:green'>AND</span>",
          "<span style='color:yellow'>ORDER BY</span>",
           "<span style='color:green'>INSERT INTO</span>",
           "<span style='color:green'>DELETE</span>"),
        $variable
        );

```

I want this to be a bit shorter and I'd like the color to be a variable.

For example: in python there are list comprehension where I would do something like this:

```
$newsql_words  = ["<span style='color:#'+randomcolor+'>'+$nice_sql_word+'</span>' for $nice_sql_word in $sql_words]

```

Any idea how to do this in php?