Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Quiz Page php
The php quiz has changed! We have replaced php questions with answers! And from those answers you'll find further links to even more information - forums where you can ask questions, training courses, longer articles, and more. [link to quiz index] ... If you really want the old quiz questions, you can find them here, here, here and here ... and with onward links to the possible answers to each question too.

Easy session example in PHP - keeping each customers data apart
When you go to a shop, you're not kept waiting outside until the previous customer leaves. The shop will have multiple shopping baskets / trollies, or muliple assistants. And that's the way you want ...

Separating program and artwork in PHP - easier maintainance, and better for the user
I can code reasonably well. But my graphic design sucks. And both skills are needed for even a simple web data entry form, or a small application. Using the PHP "bull at a gate" approach, both ...

Learning to program in PHP - Regular Expression and Associative Array examples
There's a lot to learn on a week-long PHP course - especially if you're new to programming. And delegates need practice during and after the course with some relatively straightforward (but ...

December courses - PHP, Python, Perl - and a weekend Lua course
Lua is a powerful, fast, lightweight, embeddable scripting language. It's good and has a very open license so you can use it widely - even within your commercial products - at no cost. That's made ...

Regular Expression modifiers in PHP - summary table
PHP's ereg functions are deprecated, and you should now be moving to the preg functions. See [here]. As you're switching your PHP code from ereg to preg regular expressions, you'll be adding ...

PHP - moving from ereg to preg for regular expressions
If your PHP scripts use "ereg" functions for regular expression matching, you should be aware that as from PHP version 5.3 they have been deprecated, and in PHP 6.0 the plan is to remove them ...

On this day ... one PHP script with three uses
What happened on this day in previous years? What events in history, and what was the subject of this blog? As part of a demonstration (of caching), I wrote an example script that constructed a ...

MySQL, MySQLi, PDO or something else - how best to talk to databases from PHP
One of the consideration that users of Open Source programming languages have make is which one of many ways to do any particular task. Open Source tends to result in lots of very clever facilities ...

Your PHP website - how to factor and refactor to reduce growing pains
As your project grows ... what do you change? In an ideal world, you would know exactly what you were coding before you started, and write the full job to spec to last for many years. This isn't an ...

Divide 10000 by 17. Do you get 588.235294117647, 588.24 or 588? - Ruby and PHP
If you divide £10,000 between 17 lucky children, each gets £588.23 ... but if you divide the number 10,000 by the number 17, you get 588.235294117647. How do you format the data to the ...

Do I need to initialise variables - programming in C, C++, Perl, PHP, Python, Ruby or Java.
Starting with a clean slate. Are variables initisialised, and if so, how? Even with this fundamental question, languages vary considerably. C and C++ From my (e)mailbag ... """In a piece of code ...

Computer Graphics in PHP - World (incoming data) to Pixel (screen) conversion
If you want to draw a diagram or chart on your web page, using data held on your server, chances are that the co-ordinates of the data won't match the pixel numbers that you're using on the ...

Catchable fatal error in PHP ... How to catch, and alternative solutions such as JSON
When you ask your program to "print out an object", you're really looking to convert a data structure into a stream of characters, and it's not really obvious what you're looking to do. If you try ...

Open Source (Public) courses - PHP, Tcl, SQL, Python, C and C++ in Melksham, Wiltshire, UK
Here's a revised list of public courses running at our Melksham training centre for the rest of this month, and in April and May. There are a couple of additions, and we've also reallocated a couple ...

Extra courses - Advanced PHP, MySQL and Lua
Here are some extra dates for your diary ... 21st March - Object Oriented PHP (1 day) [link] 22nd and 23rd March - PHP Techniques Workshop (2 days) [link] 27th and 28th April - MySQL [link] ...

Perl, Python, PHP, Lua, Linux, and more - and business hotel too. Menu for 2011
Whar are our plans for 2011? "Steady as she goes", I think - a gentle year of building on all we've achieved in the past year, and all that has developed in the last six months. Our hotel at Well ...

Setting your user_agent in PHP - telling back servers who you are
If your web page pulls information in from other sites, you'll be turning your web server into a client (browser) to those other sites - and just as your web server can identify the type of browser ...

Sending out an email containing HTML from within a PHP page
The mail function in PHP allows you to send a plain text email in a single function call from within your script but please read the cautions at the end of this post before you do so!. How do you send ...

PHP data sources - other web servers, large data flows, and the client (browser)
As always, I've written a sprinkling of new demonstrations amongst some well-trodden example during the PHP course I'm presenting this week: There's a really short example of how you can call up ...

Learning to Program ... in PHP. Course examples.
Most programming language courses you'll find commercially provided are really "conversion" courses - intended for delegates who have programmed before, but in a different (or very different) language ...

Handling (expanding) tabs in PHP
Question - Is a tab 8 spaces or 4? Answer - Not quiet either, really. It's a movement of the cursor forward by up to 8 spaces (or 4 spaces or some other number if you have altered your tab stops). ...

Increment operators for counting - Perl, PHP, C and others
Look at this Perl statement:   $counter = $counter + 1; "Take the value in $counter, add 1 to it, and put it back in $counter". It's a common programing requirement - indeed, so common that ...

Getting the OO design write - with PHP a example
One of the great beauties of Object Oriented Design is that you can say "I want to handle a type of data that's based on an xxx", and if someone's already written (and made available) the code for an ...

Upload Image, Store in database, redisplay in browser. PHP and MySQL
If you have just a few images that you want to display on your web site, keep them as regular files on your server. But if you've thousands, it's better to keep them in a database and server them via ...

LAMP - Linux, Apache, MySQL, PHP - install, configure, administer
Linux - Apache - MySQL - PHP. The "LAMP" combination that serves many web sites - including ours - these days. Linux provides the underlying computer operating system on which the other elements ...

PHP - Object Oriented Design in use
A web server access log file contains a whole series of hit records ... each of which is logically turned into an object as different fields have different characteristics. These hit objects can then ...

Dynamically watching your web site via a PHP wrapper
On our web site, we "wrap" all of our pages in a PHP shell, which allows us to reference extra information easily within any of our pages, provide up to date course and hotel data on every page, and ...

What is all this SESSION stuff about? (PHP)
If you're booking an airline flight online, you'll be taken through a series of screens to select route, dates, times, passengers, seats, then to enter payment details, and perhaps visa / government ...

Improving your function calls (APIs) - General and PHP
Some of the code at the Civil Service Department (CSD) where I worked on manpower planning models some 35 years ago would not have stood up to analysis against modern programming practice (but then ...

Uploading an image, document or pdf via a browser (php)
One of the most popular scripts on our web site is a demonstration, with full source code, of how you can upload data from a browser, store it into a MySQL database, pull it back from that database, ...

Exception handling in PHP
PHP has exception handling - where you can try a block of code; it it completes, that's good and normal, but if something doesn't work in the normal manner an exception is thrown, and a piece of code ...

Adding extensions to PHP Open Source applications - callbacks
Over the last two days, I've installed and configured MediaWiki, WordPress, Status.net and Drupal on one of our training systems, and looked (in each case) at how to configure them and install extra ...

Static class members in PHP - a documented example
Within a class, you can have dynamic or object variables and methods, where the code and the values associated with it are applied to individual objects. They're far and away the majority of your ...

How to build a test harness into your PHP
I was writing a PHP demonstration yesterday, and I wanted to include a test harness with my class definitions that I could leave in place on the live code on my server, to be silently skipped over ... ...

Improve your PHP on a weekend away
I'm delighted to announce two new weekend events - courses on which you can learn or improve your PHP - and enjoy yourself too. The first weekend - at the Intermediate level - is described here. ...

Compile but do not run PHP - syntax check only
The -l option to PHP on the command line compiles but does not run the code in the file - so it's very useful for syntax checking your code. Here's an example where I tested a file with a deliberate ...

Object Oriented Programming in PHP
New ... for the first time ever ... our Object Oriented PHP Programming training course is running on a Monday. That's Monday, 26th April 2010. It then revert to Friday - its more normal day of the ...

A PHP example that lets your users edit content without HTML knowledge
Scenario one. I need a "todo" list page for our web site which I, and the rest of our team, can view and update quickly and easily. Scenario two. Dave wants to provide his local cricket club's ...

Shipping a test harness with your class in PHP
If you're writing a class (or group of classes) into a file you include into your main application(s) in PHP, you'll be recommended to keep the included files out of the document path so that they ...

How to show a large result set page by page in PHP
One of the major requirements on dynamic web pages is for them to present selected results from a data set. If the results will nicely fit on one page, that's good - but if there are too many for a ...


Comment: "Nice .. very helpful! ..."
Visitor Ranking 4.2 (5=excellent, 1=poor)

Comment by David Lefkon (published 2007-06-30)
Nice .. very helpful! [#3322]

Comment by Anon (published 2007-05-04)
This was a good quiz for me as a beginner [#3312]

Comment by Anon (published 2007-02-23) Suggested link.
helouuuu, php is not a programing language, have u ever heard of server-side scripts? [#3307]

Comment by viperxp45 (published 2007-05-04)
awsome [#3304]

Comment by Graham (published 2006-06-01)
Yes - because I have no element preceeding the quoted regular expression on that particular question, the 2 or 3 letters could be preceeded by other letters as you state, thus making it "2 or more letters". Noted, question updated. Thanks for the inputs [#3132]

Comment by Anon (published 2006-06-01)
This is true, the proper answer would be the one chosen. If the question stated [a-z]{2,3,}$ then the said correct answer would be the choice. [#3114]

Comment by curtis (published 2006-03-25)
Thorough, well-planned PHP quizes! I found one question in the intermediate quiz which said I was wrong, when, indeed, I was not:

The regular expression [a-z]{2,3}$ will only match

YOU WERE INCORRECT

The answer you gave:
any string that ends with 2 or 3 lower case letters

Correct Answer:
any string that ends with 2 or more lower case letters

[a-z]{2,3} will match only 2 or 3 lower case letters at the end of a string, not 2 or more. [#340]

You can Add a comment or ranking or edit your own comments

Average page ranking - 4.2

© WELL HOUSE CONSULTANTS LTD., 2012: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho