Bulk convert images with PHP GD2

I have a directory on my server filled with .jpg images, the problem is some of these images are in CMYK and don't display in Internet Explorer as it only shows RGB images. I'd like to convert all these images to RGB format. I currently have PHP with GD and was wondering if there was a way to bulk convert all these images in this directory and it's sub directories from the command line?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Sander StadConnect With a Mentor Systeemontwikkelaar, Database AdministratorCommented:
Chris HarteConnect With a Mentor ThaumaturgeCommented:
cmyk images are not natively supported by php. To convert them you are going to have use the imagemagick PECL extention.
These are undocumented on the php site, which does not help, but here is a function that might.

There is also a user group where they discuss the same problem.
All Courses

From novice to tech pro — start learning today.