Use the following function to change any integer into a string containing the integer value as a Roman Numeral.
When people link to your images from their own site they are essentially using your bandwidth to show images on their site, this is also known as hotlinking.
The simplest way of preventing people from doing this is to add a .htaccess file to only allow locally linked images to be served. This checks the domain that is linking to your images by using the referrer and if the domain does not equal you own site then a different image is served, in this case blank.jpg.
Krumo is an open source plugin for your programs that is designed as a replacement to print_r() and var_dump(). These functions are used by developers (myself included) to find out what the program is doing. The main problem is that if there is a lot of data to look at the page can get a bit busy.
Cutting a string to a specified length is accomplished with the substr() function. For example, the following string variable, which we will cut to a maximum of 30 characters.
It is possible to find out what functions and variables are available from an object at runtime using the PHP functions get_class_methods() and get_object_vars().
Take the following class called testClass.
The $_SERVER superglobal array contains lots of information about the current page location. You can print this off in full using the following line of code.
PHP5 allows you to stop classes being extended or to stop child classes overwriting functions.
The first way to use the final keyword is to stop child classes from overwriting functions when they are created. This can be used to stop an important function from being overwritten. To use the final keyword here just add it to the start of function name.
There is little syntactical difference between MySQL 4 and MySQL 5, but sometimes finding that difference can pinpoint a bug. The mysql_get_server_info() function will tell you what version of MySQL you are using. You can call it with no parameters, in which case it picks the most recently created MySQL resource, or with the resource handle created with mysql_connect().
Here is an example of how to use it.
Sending multiple arguments to a function can be done using a parameter string. This is just like a URL that has data encoded into it. For example, if you wanted to send two parameters (called parameter1 and parameter2) to a function then you would use the following string.
To use this in the function you create the function as normal with a single parameter. This single parameter is the string that will contain all of your arguments.
When navigating the file structure in Unix/Linux environments you will often find yourself typing cd to change the directory and then immediately typing ls to see the contents of the directory.
It is possible to run ls automatically every time you run cd by adding the following commands to your .bashrc file.