It is very easy on both Windows and macOS to open a PHP file, which is never just a text file. Once opened, you can edit the code it contains.
Steps
Method 1 of 2: In Windows

Step 1. Download and install Notepad ++
Notepad ++ is a free plain text editor and is happy to open PHP files. For installation, proceed as follows:
-
in the Internet browser of your choice, go to the page
notepad-plus-plus.org/downloads/v7.8.2/;
- click on the green button DOWNLOAD (DOWNLOAD);
- double-click on the Notepad ++ executable file;
- Follow the instructions that appear on the screen.

Step 2. Run Notepad ++
If Notepad ++ does not start by itself after installation, do To start up (

), type notepad ++, then click Notepad ++ in the results list.

Step 3. Click File
The menu is in the upper left corner of the Notepad ++ window. A drop-down menu will then appear.

Step 4. Click Open
This option is in the drop-down menu. A File Explorer window will appear on the screen.

Step 5. Select your PHP file
Navigate through your folders to find your PHP file, then click once on its icon.

Step 6. Click Open
Click this button at the bottom of the window. In doing so, your PHP file opens in Notepad ++: you can then see and edit the content (i.e. PHP code) of the file.
After modifying or not, the content of your PHP file, save it using Control + S, then quit Notepad ++
Method 2 of 2: In macOS

Step 1. Download and then install BBEdit
BBEdit is a free (to some extent) code editor and can therefore easily handle PHP files. For installation, proceed as follows:
-
in the Internet browser of your choice, go to the page
www.barebones.com/products/bbedit/;
- right click on Free Download (Free download);
- double click the recently downloaded DMG file;
- authorize the opening of the compressed file;
- drag the BBEdit icon into the folder Applications;
- Follow the instructions that appear on the screen.

Step 2. Run Spotlight (

).
In the upper right corner of the screen, click the magnifying glass icon.

Step 3. Run BBEdit
Type bbedit in Spotlight, then double click BBEdit in the game Best results.
- If you are running BBEdit for the first time, click To open, then on To continue in order to benefit from the 30-day trial period.

Step 4. Click File
The menu is in the upper left corner of the screen. A drop-down menu will then appear.

Step 5. Click Open…
This is the second menu option File. A Finder window appears on the screen.

Step 6. Select your PHP file
Navigate through your folders to find your PHP file, then click once on its icon.

Step 7. Click Open
Click this button at the bottom of the window. In doing so, your PHP file opens in BBEdit: you can now make changes to the content or just view it.
- Sometimes the open button is marked To choose.
- If you change the contents of your PHP file, remember to save the file periodically by doing Command + S.