Lookup the IP address of a country with ip2country
This class can lookup related information of the country of the network of a given IP address.
It does not need an SQL database server as it uses the ip2country flat file databases to lookup the the IP country and other details like the country ISO 2 and 3 letter codes, FIPS104 code, ISO number, region, capital, currency name and code and flags.
The class can also generate select inputs for choosing a country in Web forms. The select input default country can optionally be set to the country of a the user's IP address.
New In v3.0:
- If the IP address was not found in the local database, Its info will be fetched from Whois server.
- A new function added "find_country": This function was suggested by 'Nizam', It will find a country by providing any info about it (name, iso2, iso3, fips104 OR even the Capital)
- The fips104 field in countries list, was updated. thanks to 'Nizam'
- A new function added "is_valid_ip": it will check the validity of the passed IP address
Note:
You can change the WHOIS service to any other one you might know.
But if you did so, don't forget to change the $whois_regex and $whois_return.
(Till I finish documentations you will find detailed comments in i2m.class.php)
Template engine based on real HTML tag replacement
Incredibly easy and powerful templating class - Separate your code from your HTML. The code is extremely compact and fast. Uses regular expressions to do most of the work.
This powerful class implements a template engine based on tag replacement. It can load templates from files and replace tags with template parameter values.
The template tags are special HTML comments (or ACTUAL HTML TAGS). They can be replaced with arbitrary HTML, arbitrary text to be escaped as HTML, text read from files or remote Web pages, or another template.
New version 2.5: Now you can use actual HTML tags as template tags! Use ANY HTML editor to create your templates.
Replace an HTML tag or just the tag's data. Change actual existing tables, dropdowns, and list data on the fly with arrays - while still keeping all attributes and style information. Grab a table from a page on another site or create SELECT OPTION lists on the fly - all from one single line of code.
Supports database records, numbered arrays, and associative arrays - and can even populate table headers using array keys... and LOT'S MORE.
Methods were separated into an extended class for performance (because they use the regex engine). The separation of code also makes the class more maintainable, faster, memory efficient and easier to use for smaller projects. Use "Template" for simple templating and "TemplateHTML" for ultra high performance HTML support where actual form elements can be used as template tags.
(Still compatible with 1.x code - works GREAT with Ultimate MySQL class)
With this class you can easily access text files (read/write).
With this class you can easily access text files (read/write). get the X Line of a text file. write after line x in the file. return lines containing "foorbar" (with regex). replace a line. and so on...
A base class and 2 derivated classes to generate clients for dictionary servers
that follow the DICT protocol (RFC 2229), such as the server at dict.org
Included also 2 examples of query interfaces generated using these classes, one performs
a simple search, and the other shows how to get information from the dictionary server
and use that to generate a form allowing for more complex searches.
[UPDATE: 2000/06/05] Fixed some bugs reported by Davor Cengija <davor@croart.com> and
found another bug related to URLs referred in the definition that are also marked as
crossrefence terms
[UPDATE 2000/06/06] Check for duplicates when creating the links, and
modified the external URLs regex to recognize more protocols, as well
as eliminate crossreferences to RFC's (example scripts)
[UPDATE 2000/06/07] Stoyan Jekov noticed that I forgot to close my HTML FORM element