It’s realy cool library, you don’t need PEAR library, or other’s files. Now you can parse your xls to array. Example of usage: <?php require_once 'reader.php'; $filename="test.xls"; $prod=parseExcel($filename); echo"<pre>"; print_r($prod); function parseExcel($excel_file_name_with_path) { $data = new Spreadsheet_Excel_Reader(); // Set output Encoding. $data->setOutputEncoding('CP1251'); $data->read($excel_file_name_with_path); $colname=array('name','price','old_price','in_price','descr','status','sku','pos','stock','in_name','manufacturer','supplier','photo'); for ($i = 1; $i <= $data->sheets[0]['numRows']; ...
Litle hack to rotate many banners in one block. First of all you need to add all your banners at block, and then open this file: /skins/THEME_NAME/customer/addons/banners/blocks/original.tpl
phpLiteAdmin is a web-based SQLite database admin tool written in PHP with support for SQLite2 and SQLite3. Following in the spirit of the flat-file system used by SQLite, phpLiteAdmin consists of a single 100KB source file that is dropped into a directory on a server and then visited in a browser. Setup is as simple ...
I use imagefilter to create images for CSS sprites on the fly. This is part of my code:
This small regular expression help you to find all flash elements in $body variable. preg_match_all("/<object[^>]*?>.*?<\/object>/si",$body,$out);
Learn how inheritance works in PHP. This tutorial explores the concept of parent and child classes; overriding methods; final classes; abstract classes, and interfaces. Example code included. We’ll look at the following topics in this article: The concept of inheritance, and why it’s so useful How one PHP class can inherit from another How a ...
function test () { $args = func_get_args(); //get all arguments into array foreach($args as $num=>$val) { echo '<p>'.$val.'</p>'; //print argument } } The same useful functions: func_num_args() -get num of passing arguments func_get_arg(n) - get argument by it number