View more - reording array keys from zero
Posted by andphe on Tue Jul 27 16:17:19 UTC 2010.
Language php
<?php
//If you have a array that need to re-key from zero
//can use $thearray = array_merge((array),$thearray);
//Example:
$array = array(4 => 'four', 3 => 'Three', 2 => 'Two', 1 => 'One');
var_dump($array);
$array = array_merge(array(),$array);
var_dump($array);
View more - Mini OOP wrapper for Mysql PHP functions
Posted by nebiros on Fri Feb 26 16:51:47 UTC 2010.
Language php
<?php
class App_Db_Adapter_Mysql
{
protected $_options = array(
"host" => "localhost",
"username" => "root",
"password" => "",
"dbname" => ""
);
View more -
Posted by nebiros on Fri Feb 26 14:23:17 UTC 2010.
Language php
<?php
if ( false === empty( $_FILES ) )
{
$extExplode = explode( ".", $_FILES["image"]["name"] );
$ext = strtolower( array_pop( $extExplode ) );
$uniqId = md5( uniqid( rand(), true ) );
$imageFilename = "{$uniqId}.{$ext}";
if ( false === move_uploaded_file( $_FILES["image"]["tmp_name"], APPLICATION_PATH. "/images/{$imageFilename}" ) )
View more - Generar archivos para MS Excel en CakePHP usando PHPExcel
Posted by andphe on Sat Feb 20 01:05:10 UTC 2010.
Language php
<?php
/**
* Esta vista genera al vuelo un archivo en formato MS Excel 2007
* restringiendo los valores que las columnas de los atributos
* pueden tomar.
*
* Requiere http://phpexcel.codeplex.com/ instalado la carpeta
* app/vendors
*
*/