PHP How can I validate / verify a wallet public key?


Can someone please help me find some PHP open source on how to validate / verify a bitcoin wallet public key ? I am currently working on a project and I am implementing multisig, and it seems I can’t find any type of information on how to verify / validate a wallet public key.

Example of public key that I am trying to validate: xpub661MyMwAqRbcEwAAmd9DpSfoDEUar3C2e8LtpeMCaaPWMoLjAf3jY3RucUmtim729c2qzGmYPaBcFdkEUQuwgrFjTKFwEKSCfRfd949k4DC

Basically, I want to make sure the user can’t add a wrong or invalid key, otherwise the multisig wallet cannot be created when the system will try to create it, and I need to prevent that

Thank you for your time!