When running this shell command using passthru:

```
convert example.pdf -threshold 50% -format %c histogram:info:- 2>/dev/null

```

I get a string like this in my PHP script:

```
12422: ( 0, 0, 0)   black 488568: (255,255,255) white

```

I want to end up with a PHP array like this:

Array
(
 [black] => 12422,
 [white] => 488568
)

Can anyone show me an efficient way to do this in PHP?

The output running this on the shell is formatted like  

196: ( 0, 0, 0) black  

500794: (255,255,255) white

Thanks