Skip to content

portsoc/introphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Install, Investigate and Experiment

Here are some introductory PHP examples. To run them examples on your VM (which already has PHP installed for your convenience)...

  1. Login to your VM
  2. git clone http://github.com/portsoc/introphp.git
  3. php -S 0:8080 -t introphp
  4. Check the IP address of your VM, and type this into your preferred browser to load a copy of this page from your server. From there you can try the examples, and then change them to your specifications.
  5. If you're using Chrome, try Mike's LivePage extension to update the browser content as you change the source files.
  6. For editing the files on server, you can use nano as a simple text editor (ctrl-o to save, and ctrl-x to exit); or edit on your computer and upload the files to the server on every change.
  7. If you're using Atom, the Remote Sync package (or similar ones) may help you with the uploads.

Echo

  1. The basic Hello World Program
  2. Hello World Program with Variables and Concatenation
  3. Hello World with Variables and Template Strings

Numbers

  1. Simple arithmetic
  2. Simple arithmetic with parameters and variables - a, b.
  3. Message loop - msg, count.
  4. Conditional Message loop - msg, count, mod.

Special Variables

  1. PHP has a several special variables containing useful data.
  2. The special phpinfo() function.

Forms & Files

  1. Getting data from forms - name.
  2. Storing a list of visitors - visitors.txt.

Includes

  1. Including other files.

About

A lightning teaser intro to PHP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages