(Moved to ClientSide Technologies forum)
bsdux wrote:I want to do this in PHP code.
Opening links in new windows has nothing to do with PHP - PHP doesn't know what a "link" or a "window" or even a "browser" is.
At any rate, if you want to be XHTML compliant, you're actually supposed to use rel instead of target I believe:
<a href="http://link" rel="external">New Window</a>