Contest Submissions Have Closed
Thank you for your interest in WestHost's PHP contest. As of March 16th, 2011, the contest is closed for new submissions. We would like to thank our sponsors, System 76, Zend, and php|architect and all who participated in the contest.
Congratulations to the following individuals for their winning functions:
- Mark Willis
- Joost de Valk
- Klaus Silveira
- Fabian Schmengler
- Michal Vrchota
- Jan Martinek
- John Proffer
- Jakub Vrana
- Weldan Jamili
This function returns center of any two unsigned integers. It works with any type of data types.
Compress Upload Image Size and Re-Size Image
Converts time in the format: HH:MM:SS and HH:MM into AM/PM format. E.g: 13:05:00 -> 1:05 PM 15:30 -> 3:30 PM If the time is in the format: HH:MM instead of HH:MM:SS, set the 2nd argument to false.
This function takes a date in mysql date format, i.e 2011-06-30, and returns a more easily readable date, e.g 6th June, 2011.
A small and function for display past time that user posted (like 1 hour ago...). We just don't care the exact time like: he posted 2 days 1 hour 3 minutes ago. The logic is, the futher an event, the less we care about the exact time.
try Repeat allows you to continuously execute a function until it returns true. $wtry = new tryRepeat('$this->objct->connect();',300,$dbLayer); first argument = function or method call second argument = time between trys third = object for method call also optional
There is no quick and convenient way to convert XML into an assoc array (that I know of). This concise function does just that using json_decode & json_encode. Compatible only with PHP5 and up. Also, requires the JSON extension.
This function will return an array by any key held within the array. Very nice for sorting by returned columns from a database.
Returns the value of an array by key when the array is returned via a function call. Ex: $x = dereference(func(),'someKey'); instead of $arr = func(); $x = $arr['someKey'];
Function is used to get memory limit of particular disk and will print memory space in according to kilo, mega, giga, tera bytes level
Custom Web Design
Want to get really creative? Bring your ideas and we'll make them a reality. Our expert web designers can help you get started today!
Continuous Data Protection takes a snapshot of your site every six hours and allows you to restore as many or as few files as you wish; all done without talking to anyone but your keyboard. Add it in the order form.
Hosting SolutionsWeb Hosting
Domain RegistrationRegister a Domain
Information CenterAbout WestHost
Terms & Policies