chapter1PHPTUT-nicephotog

download chapter1PHPTUT-nicephotog

of 1

Transcript of chapter1PHPTUT-nicephotog

  • 8/9/2019 chapter1PHPTUT-nicephotog

    1/1

    PHP.NET (the home of the PHP web script engine)

    nicephot.xlphp.net - PHP - Tutorial

    Chapter 2 More about handling text data in PHP

    Since this site is hosted for the promotion of PHP i have decided to include a" tutorial" on PHP aside to javascripting.My actual site is at www.nicephotog-jvm.net

    To be able to understand and utilise this tutorial you will require some comprehension of web sites file system naming and addressing both internally and onthe www,also, a good knowledge of HTML tagging mark-up language. If you know another script language to any usable level, that also will help.PHP is a script language.Script languages pass their data to a run time interpreter/compiler and are written in text but not compiled to instructions or bytecode command binaries. The interpreter/run time compiler loads and reads the script that contains the instruction sequence language text and executes it withthe script engine binaries.I first wrote a PHP script for my site as a search engine to see its compatibility with the PERL programming language. I found that it only quite stacks up inPERL to say it is compatible but then it wouldn't be a promotion of itself if it was. Largely its compatibility usefulness difference is regular expressionconstruction being not completely supported but it does make a similar language at many levels that PERL has.Unlike PERL, PHP is a much more deliberate Web Oriented language as its complete name suggests. It handles many functions for web servers in pre-definedfunctions that are simply not present in the PERL language and are also simply a system hack to produce an equivalent.

    This tutorial is a simple introduction to the common and basic activities in PHP and not directly to produce any proficiency, also i need to clean up myknowledge of PHP because i use a large selection of languages for programming and the list of new technologies on the market is growing of number.One final thing to do is to download yourself a PHP Language Manual from PHP.NETThis tutorial uses 4 , but there could be version 5 information added for some purposes.Be careful to read the versioning for each of the functions in the php manual.(Save As ZIP) THE CODE PRESENTED IN THIS TUTORIAL

    The composition that a PHP program has.========================================

    OR

    #!/usr/bin/php/php

    a shebang line(to start the script) and no actual file end.similar to the PERL or Shell script shebang forinternal script job running to tell the script whereto find the php.bin(unix) or php.exeexecutable program.

    To start the actual program structure, all the required "global" variables will be declared atthe top before any other program parts. Variables are a reference(memory) for values fed tothe script (usually, and most are simply data) to be operated on. Other referencing actions can

    be made the same way for program parts(and are not data/return data) called an Object butare too complicated to explain at this point not that remembering something isn't.

    e.g.