If you used the command line PHP (CLI) the printing to network printers would work. Your $addr is correct by the way.
The issue lies with PHP when you combine it with Apache. In windows, your php scripts would run under the user SYSTEM. Because of security concerns, all network resources are not visible to SYSTEM.
To resolve this problem, create a new user with admin privileges (or at least with Network Resource visibility). In Windows, if you run Apache as a service, click on the SERVICE button in the Apache Service Monitor. Under Apache 2.2, right click on properties. Under the LOGIN tab, change the user from SYSTEM to your newly created user account. Restart Apache. You should be able to run your PHP script to print to network printers now.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…