Accessibility

Table of Contents

Integrated PHP and Flex development with Zend Studio and Flex Builder

Hello World!

To experience the ease and speed of developing with these integrated tools, take a run through the inevitable "Hello world!" example. Begin by setting up a new PHP project with the Zend/Eclipse version of the IDE by selecting File > New > PHP Project, as shown in Figure 9.

Creating a new PHP project

Figure 9. Creating a new PHP project

In the PHP Project dialog box, type helloWorld in the project name box, and then clear the Use Default option. In the Directory field, type a path beneath the web root of your web server—in this case, [web root]/helloWorld, as shown in Figure 10.

Specifying a project directory

Figure 10. Specifying a project directory

Click Finish. Your PHP project is created and displayed in the upper left pane of the IDE.

Now, you need to create a PHP file within your project. To do so, right-click the project folder icon in the upper-left pane, then select New > PHP File, as shown in Figure 11.

Adding a new PHP file to the
project</em>

Figure 11. Adding a new PHP file to the project

In the new PHP file dialog box, type the name of or browse to the source folder. In the file name box, type helloWorld.php, and then click Finish, as shown in Figure 12.

The New PHP File dialog box</em>

Figure 12. The New PHP File dialog box

An empty PHP file opens in the main pane of the IDE. Beneath the <?php tag, type:

$msg = "Hello world! It's me, PHP!";echo $msg;

Your file should now look similar to the one depicted in Figure 13.

The timeless Hello
world!

Figure 13. The timeless "Hello world!" application

Save the file, and your PHP code for this example is complete.