Saturday, April 20, 2013

Dynamic selection of year list in php

Dynamic selection of year list in php

To avoid the need to write up to many lines in your HTML forms. PHP for loop helps us for that. Use below simple code for that <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ echo ""; for($year = 1990; $year < date("Y")+1; $year++) { echo...

Friday, April 19, 2013

Generate a CSV file from MySQL records

Generate a CSV file from MySQL records

This class can generate a CSV file from MySQL query results. It can connect to a given MySQL database and execute a SQL query. The class can generate a CSV file from the query results. The CSV file may have headers generated from the query result column names...
Forex Class for PHP 5

Forex Class for PHP 5

This class can convert money amounts between currencies using iGoogle calculator API. It can send a HTTP request to the iGoogle calculator API to convert a given money amount between to given currencies. The class parses the response and returns an array with the original and converted values...
class_exists() function

class_exists() function

The class_exists() function is used to determine whether or not a class is defined in the script. It returns a boolean value of either TRUE or FALSE. example.php <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ include_once("cart.php"); if(class_exists("cart")){ $shopping_cart = new cart(); echo $shopping_cart->store; } else...

Saturday, April 13, 2013

Handle csv file using php

Handle csv file using php

Assume, I got the following content in my csv file: "data", "data1", "data2", "data3""data", "data1", "data2", "data3""data", "data1", "data2", "data3" You can use fgetcsv to parse a CSV file without having to worry about parsing it yourself. example from php.net <?php /* Online PHP Examples with Source Code website:...

 

© 2014 4everTutorials. All rights resevered.

Back To Top