Subdomain Posts
PHP | 1 day ago
None | 1 day ago
None | 1 day ago
None | 1 day ago
None | 3 days ago
PHP | 3 days ago
PHP | 4 days ago
Objective C | 4 days ago
None | 4 days ago
None | 4 days ago
Recent Posts
C | 1 min ago
None | 1 min ago
None | 2 min ago
PHP | 4 min ago
None | 5 min ago
PHP | 6 min ago
None | 6 min ago
None | 7 min ago
XML | 7 min ago
None | 8 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Palocz Pal on the 7th of Feb 2010 12:04:11 PM Download | Raw | Embed | Report
  1. <?php
  2. // $Id: zipcode.hu.inc,v 1.9 2009/08/26 16:32:02 thierrygd Exp $
  3.  
  4. // Copyright 2008 Thierry GUEGAN http://www.arvoriad.com
  5.  
  6. /**
  7.  * @file
  8.  * CCK Field for Hungarian zipcodes.
  9.  */
  10.  
  11. /**  
  12.  * Verification for Hungarian zipcodes.  
  13.  *
  14.  * @param string $text
  15.  * @return boolean Returns boolean FALSE if the zipcode is not valid.
  16.  * On success, returns a string containting the zipcode with some formatting.
  17.  */
  18. function valid_hu_zipcode($zipcodestring) {
  19.   $zipcodestring = trim($zipcodestring);
  20.  
  21.   if (!preg_match("/(^\d{4}$)/",$zipcodestring)) {
  22.         return FALSE;
  23.   }
  24.   //right now just do a quick check ==> has to be improved
  25.   //need to check more precisely by doing a query on a zipcode table, ...
  26.   else
  27.   {
  28.         return TRUE;
  29.   }
  30. }
  31.        
  32. /**
  33.  * Formatting for zipcode.  
  34.  *
  35.  * @param string $zipcodestring
  36.  * @return string Returns a string containting the zipcode with some formatting.
  37.  */
  38. function format_hu_zipcode($zipcodestring) {
  39.  
  40.   $zipcodestring = trim($zipcodestring);
  41.   //do some formatting
  42.   return $zipcodestring;
  43. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: