Getting Visual Studio Code to recognise my PHP installation - PHP - SitePoint Forums | Web Development & Design Community
debugging - How to run or debug php on Visual Studio Code (VSCode) - Stack Overflow
How to customize Visual Studio to php development?
How to use PHP with Visual Studio - Stack Overflow
How do I debug PHP in VS Code?
What’s the best way to format PHP code?
How do I enable error reporting in VS Code?
Videos
So I've been using XAAMP to run PHP on my laptop and it works as it should. But it requires me to use a URL and then find the projects within the htdocs folder. I was wondering if there was something like Live Server that I could activate from Visual Studio and have it appear in the Web Browser.
I've done google searches on this already and it led me to download php extensions like php server and the php debugger extension.
However, I am a bit confused by these and what they do and I'm not sure if this is supposed to perform in a similar way that live server performs.
I've ran into issues though in getting VS Code to use the correct environmental variable. It keeps throwing an error that says the binaries couldn't be found or executed even though I have the path set in the json file to the folder holding the PHP related code.
I'm a bit confused and I'm also curious about whether or not what I'm trying to do is achievable or not.
Debugging PHP with VSCode using the vscode-php-debug extension
VSCode can now support debugging PHP projects through the marketplace extension vscode-php-debug.
This extension uses XDebug in the background, and allows you to use breakpoints, watches, stack traces and the like:

Installation is straightforward from within VSCode: Summon the command line with F1 and then type ext install php-debug
As far as I read about it today, you can't debug anything else than node.js, JavaScript and TypeScript at the moment, but they said they want to add new languages which you can debug. The editor is still in development. Nevertheless, I don't think there will be a php debugger in the future since php is serverside, so you can't debug it on your client alone.
If you want to debug php, I can recommend xDebug.
Updated:
Now, it is possible to debug with VS code. You need to install XDebug and php-debug extension for VScode.
By default VS is not made to run PHP, but you can do it with extensions:
You can install an add-on with the extension manager, PHP Tools for Visual Studio.
If you want to install it inside VS, go to Tools > Extension Manager > Online Gallery > Search for PHP where you will find PHP Tools (the link above) for Visual Studio. Also you have VS.Php for Visual Studio. Both are not free.
You have also a cool PHP compiler called Phalanger:

If I'm not mistaken, the code you wrote above is JavaScript (jQuery) and not PHP.
If you want cool standalone IDE's for PHP: (Free)
- Netbeans: https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=php
- Eclipse: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr
Maybe we should help you with a big misunderstanding on your side first: PHP is (like ASP.NET or whatever you used to far) a server side language while javascript is client side.
This means that PHP will run on your webserver and create a HTML page dynamically which is then sent to the browser. Javascript in turn is embedded (either directly or as a referenced file) into this HTML page and runs in the browser.
Maybe you can now understand why your approach so far could never work out.