If you use the PHP command line (CLI), printing to network printers will work. By the way, your $ addr is correct.
The problem is PHP when you combine it with Apache. On Windows, your php scripts will run under the SYSTEM user account. Due to security issues, all network resources are not displayed in SYSTEM.
To fix this problem, create a new user with administrator privileges (or at least with the visibility of a network resource). On Windows, if you start Apache as a service, click the SERVICE button in Apache Service Monitor. In Apache 2.2, right-click on properties. On the LOGIN tab, change the user from SYSTEM to the newly created user account. Restart Apache. Now you can run your PHP script to print on network printers.
source share