MySQL has a built in substr function
Someone once showed me how it can be used as a search feature but i'm not entirely sure how to use it as a condition. I know it definately can be though. You could split you array into individual strings such as ' AND SUBSTR('ll',1)' or however it's used and then put $conditions at the end of your SQL query
With me?
Edit:
http://www.mysql.com/documentation/m...61/content.htm