Swap array
Swaps all array values to array keys and vice versa.
Since PHP 4 there exists a build in function for this snippet:
array_flip.
Swaps all array values to array keys and vice versa.
Since PHP 4 there exists a build in function for this snippet:
array_flip.
There are many ways to get random database results, here I explain two of them.
I made this snippet to show how to use the Last-Modified and the ETag header
to optimize the caching of a website. If used correctly this will speed up
your page loads.
This function splits a array into a given size.
This can be useful for creating columns or dividing a
list in multiple parts.
Simple example of the ROT13 algorithm. ROT13 is a simple function which rotates the
characters of a string 13 places forward.
Hint:
Since PHP 4+ you can use the PHP build-in function str_rot13.
This is just a example implementation to show how it works.
This example shows how to delete specific files
after a given time span.
This works good for cleaning cached files.
Below is a MD5-based block cipher (MDC-like), which works in 128bit CFB mode.
It is very useful to encrypt secret data before transfer it over the network.
This snippet converts a “dirty” string that may contain special characters into a machine compatible nice looking string.
That function works fine for creating urls or ID keys.
Welcome to WordPress. This is the first post. Edit or delete it, then start blogging!