You need more than just the twitter IDs to post on their behalf. They will have to authenticate the application first.
This generates two tokens
OAuthTokenSecret, which can be stored in your database back-end and consequently, be used from your PHP back-end to post on behalf of the user, till the user deauthorizes your application, at which point
OAuthToken won’t function anymore.
Twitter OAuthTokens do NOT expire, but the user can revoke your access.
You can implement the above in PHP using one of the Twitter PHP libraries
solved Post a tweet automatically from a PHP webservice without userinteraction for multiple twitter accounts