Zend - The PHP Company




Code Gallery: RobF


array expand  

Type: code fragment
Added by: robf
Entered: 28/05/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 5232
an enhanced version of array_merge - only adds on unique elements. Only works for simple (i.e. not associative) arrays


array to hidden fields  

Type: application
Added by: robF
Entered: 19/06/2000
Last modified: 09/12/2010
Rating: **** (8 votes)
Views: 19428
takes a multidimensional array and puts all the elements into HTML hidden input types so data can be carried through to another page


caesar shift  

Type: code fragment
Added by: robF
Entered: 03/11/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 5504
Totally useless script to caesar shift a given message.


Change colour format  

Type: code fragment
Added by: robf
Entered: 14/03/2000
Last modified: 08/12/1999
Rating: **** (3 votes)
Views: 6923
Takes a hex colour in standard HTML format and returns a three element array in which each element is the decimal R, G, or B value which can then be used, for instance, in GD funcitons


data verification functions  

Type: code fragment
Added by: robF
Entered: 16/11/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 6724
a few simple functions to check the validity of internet hostnames, IP addresses etc.


find files  

Type: code fragment
Added by: robf
Entered: 28/05/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 5644
Returns an array of files under a given directory whose names match a given pattern.


Google search string logger  

Type: application
Added by: RobF
Entered: 14/04/2002
Last modified: 04/12/2001
Rating: - (fewer than 3 votes)
Views: 10256
Records the query strings people used to find your site through Google.


Match line  

Type: code fragment
Added by: robf
Entered: 21/03/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 6454
return the first line in a given file containing the given string


Ordinal number printer  

Type: code fragment
Added by: robf
Entered: 28/04/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 7080
Feed it "21" and it returns "21st". Prints any number with the appropriate English ordinal suffix.


Random File  

Type: code fragment
Added by: robf
Entered: 17/03/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 7269
Picks a file at random from the given directory. Accepts wildcards.


Remote image checker  

Type: code fragment
Added by: robF
Entered: 16/06/2003
Last modified: 06/12/2002
Rating: - (fewer than 3 votes)
Views: 4198
If you have a message board which allows people to post inline images with the IMG tag, you can use this function to run a few checks on the remote image. Simply pass it the URI to the image, and it checks the file exits; that it is a recognised image format; and that it is smaller than a predeterminted size. This stops mischief-makers linkng your page to a 4TB file.


The Chegulator  

Type: application
Added by: robF
Entered: 03/06/2003
Last modified: 09/12/2002
Rating: - (fewer than 3 votes)
Views: 4386
A brutal hack in PHP and shell to get and display results from Fark (www.fark.com) Photoshop competitions


Time until event  

Type: code fragment
Added by: robf
Entered: 14/03/2000
Last modified: 08/12/1999
Rating: ***** (3 votes)
Views: 9492
Tells you how long there is until a given time




Search