I got the following error when I run a command with php
php
C:\\xampp\\htdocs>php \'php\' is not recognized as an internal or external command, o
Add C:\xampp\php to your PATH environment variable.
C:\xampp\php
PATH
Then close your command prompt and restart again.
Note:
It's very important to close your command prompt and restart again otherwise changes will not be reflected.