- 1). Launch your editor, and enter your PHP coding between "<?php" and "?>" tags. Use the following example:
<?php echo '<p>Welcome to my site</p>'; ?>
Save the file with a ".php" extension, for example, "index.php." - 2). Optionally, upload the file to your server, and navigate to your page in a browser. This is useful for testing your file.
- 3). View your web page source. The PHP code has generated the following:
<p>Welcome to my site</p>
previous post
next post