Hi Im building a User relationship management application in php, here in this application we would require a multi user chat application in php, since im new to chat based application if any one have a chat application in core php please do share with me if would be very helpfull
Probably not an exact answer to your question, but could be useful.
Building a multi-user chat system from scratch on bare PHP, is a lot of work. You might want to look into php frameworks that save you at least half of the work.
Have a look at Laravel Framework: https://laravel.com/docs/5.6
It can integrate 3rd party services, example Pusher(https://pusher.com/) to run a multiple channel chat.
There are a lot of tutorials on youtube.com or https://laracasts.com/ (Laravel dedicated resource center and forum) that can help you get a chat up and running within an hour or two.
Why don't you integrate socket.io in your application.