How to Check Your PHP Syntax on a Mac

How to Check Your PHP Syntax on a Mac thumbnail
Syntax highlighting is important for checking syntax.

Checking PHP syntax is key when writing lots of code. Luckily, many IDE (Integrated Development Environments) for Mac computers offer syntax highlighting and predictive text completion, helping you to ensure that you write good, syntactically correct code. By using an IDE that supports features such as these, you will be able to write good code quickly.

Instructions

  1. Checking PHP Syntax with NetBeans

    • 1

      Navigate to NetBeans Download page and download and install the PHP NetBeans IDE if you have not already done so.

    • 2

      Open NetBeans from the Applications folder on your Mac.

    • 3

      Create a new PHP file (File -> New File -> PHP File) or open (File -> Open File...) an existing PHP file.

    • 4

      Type new PHP code or view existing PHP code. The code is syntax highlighted.

    • 5

      Type the beginning of some PHP code. A list of statements and functions will be displayed in a box below the code, providing you with a list of options.

    Checking PHP Syntax with Aptana

    • 6

      Navigate to the Aptana website and download and install the IDE if you have not already done so.

    • 7

      Open Aptana from the Applications folder on your Mac.

    • 8

      Open an existing PHP file (File -> Open File...) or create a new one (File -> New -> File).

    • 9

      Type some PHP code into the IDE. Syntax highlighting should be present.

    Checking PHP Syntax with Komodo

    • 10

      Download and install Komodo if you haven't already done so. This will provide you with a trial. If you wish to continue using the software after the trial period, you wil need to purchase it.

    • 11

      Open Komodo from the Applications folder on your Mac.

    • 12

      Create a new PHP file (File -> New -> New File...) or open (File -> Open -> File...) an existing file. Save the file as a PHP file by selecting "File -> Save As..." and including the .php extension as the file type.

    • 13

      Type PHP code in to the IDE. Syntax highlighting should be present.

    • 14

      Type a few letters of a php statement or function. A box should appear underneath with a list of possible options.

Related Searches:

References

  • Photo Credit Comstock/Comstock/Getty Images

Comments

Related Ads

Featured