Most carriers have integrated SMS-to-email. If you can bother your users to send their SMS messages to an email address instead of a shortcode or NPA-NXX style number, you'll be way better off in terms of integration and cost.
This only works if you know the carrier that your user uses, because presumably you have to route a reply back to them through an email-to-SMS gateway.
I don't personally know of any frameworks in PHP that will help you, but for Rails there are SMSFu and MMS2R, both of which are good at handling gateway SMS traffic.
You might peek at their code to see how they did it. Both are MIT Licensed.