Where C:\path\to\php is the folder where your php.exe file is located. After this run
C:\>php -v
than you will see something like
PHP 7.3.6 (cli) (built: May 29 2019 12:11:00)
UPDATE:
If you find that when you restart your computer, this solution will not work anymore:
Set the Path like as following:
Step 1 - Click on the Windows icon
Step 2 - Click on the Settings icon
Step 3 - Click on System
Step 4 - Click on About
Step 5 - Click on System info
Step 6 - Click on Advanced system settings
Step 7 - Click on Environment variables...
Step 8 - Select Path row and then click Edit
Step 9 - Click New and then click Browse, then in the next panel which will open you need to select the folder you want in the Path. For the initial premise of this guide i will add the folder C:\Users\NewFolderInPath♥
Note: Replace your PHP installed path(e.g:C:\Program Files\php) with the above path ♥.
Step 10 - Click OK and click every OK button you will encounter to close every previous windows.
For Beginners to anything php, it is usually stored in the C:/ path folder of your PC (My Computer).
==On Windows==
1.Click Start Menu button
2.Type cmd and press enter to select the first program/application that responds to your search result.
A black window terminal will appear, this is known as a Command Line Interpreter
3.In the Terminal Window (Application) Type cd c: and press enter
4.Now type php -v and press enter
and viola there you'll have the current php version that is installed in your machine
Easy Method is:
Just copy the file cmd.exe from c:/windows/system32/ and paste it to C:\xampp\php\
and run it,
when the cmd opens type " php -v " without quotes and hit enter...
you will get your php version..
thank you
If you are using any local server like Wamp, Xampp then Go to this Steps
Go to your drive
Check xampp or wamp server that you installed
Inside that check php, if you got then go for next step
You will find php.exe,
Once you get php.exe then you are done.
Just type the path like below, here i am using XAMPP and type v for checking version and you are done.