can somebody explain steps i should follow to implement SSO on php based website. e.g user logs in to www.siteA.com and when he goes to www.siteB.com he should be already logge
Take a look at Simple Single Sign-On for PHP.
OpenID isn't quite the same thing. Single-sign-on is about logging on in one place and having that authenticate you at other locations automatically. OpenID is about delegating authentication to an OpenID provider so you can effectively log on to multiple sites with the one set of credentials.
It's worth noting that StackOverflow uses OpenID to associate a user between different sites. Is this what you mean? Because that's not SSO as you need to separately log on to each site. Also, some OpenID providers (notably Google) don't play ball in the sense that they don't send the same identifier to each site so you have no way of knowing that a token on each site originates from the same set of credentials.
You could use OpenID as your authentication scheme for SSO but that's incidental.