Tag Archives: php

Generate a dropdown list of timezones in php

By | February 14, 2018

Applications often allow users to select their timezones for reporting the proper time properly. Here is a quick function that can be used to generate a dropdown list of timezones that is easy to read and understand. <?php function get_timezones() { $o = array(); $t_zones = timezone_identifiers_list(); foreach($t_zones as $a) { $t = ''; try… Read More »

Php array of iso 639-1 language codes and names

By | September 2, 2023

Here is a php array containing the language codes and language names as specified by the iso 639-1 standard. Useful when . <?php /** ISO 639-1 Language Codes Useful in Locale analysis References : 1. http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes 2. http://blog.xoundboy.com/?p=235 */ $language_codes = array( 'en' => 'English' , 'aa' => 'Afar' , 'ab' => 'Abkhazian' , 'af'… Read More »

Generate code39/isbn barcodes in php with mpdf

By | May 27, 2013

Barcodes Barcodes are used in various business class applications to print information in encoded format such that it can be read later by barcode reading devices. Common places to see barcodes are product covers in shops, membership cards and documents like invoices etc. As php is now increasingly being used to develop such applications, barcodes… Read More »

PHP : Add Login with Github to your website

By | May 9, 2020

Github Login Github has become a very popular social login on websites related to programming and development. Github itself is a big storehouse of opensource projects and community of developers. Github oAuth documentation can be found at http://developer.github.com/v3/oauth/. Register website with Github oAuth The first thing to do would be to register your website with… Read More »

Use clientside ssl certificate with curl and php

By | June 13, 2012

Clientside certificates are often used in soap webservices. For example the wsdl file link might require a clientside certificate. The server throws an error like this : HTTP Error 403.7 – Forbidden: SSL client certificate is required. Curl Command To use clientside certificate with curl , test the following command curl –cert certificate_file.pem https://www.example.com/some_protected_page or… Read More »

40+ Useful Php tips for beginners – Part 3

By | April 7, 2012

Part 2 26. Avoid direct SQL query , abstract it $query = &quot;INSERT INTO users(name , email , address , phone) VALUES('$name' , '$email' , '$address' , '$phone')&quot;; $db-&gt;query($query); //call to mysqli_query() The above is the simplest way way of writing sql queries and interacting with databases for operations like INSERT, UPDATE, DELETE etc. But… Read More »