class mymoduleActions extends sfActions
{
public function executeUpload($request)
{
if ($request->hasFiles())
{
foreach ($request->getFileNames() as $uploadedFile)
{
$fileName = $request->getFileName($uploadedFile);
$fileSize = $request->getFileSize($uploadedFile);
$fileType = $request->getFileType($uploadedFile);
$fileError = $request->hasFileError($uploadedFile);
$uploadDir = sfConfig::get('sf_upload_dir');
$request->moveFile($uploadedFile, $uploadDir.'/'.$fileName);
}
}
}
Syntax Error , Unexpected ‘]’ in C:\xampp\php\browscap\browscap.ini on line 297.

Unexpected Error Caused while upgrading php 5.3
Hypertext Preprocessor :: PHP some time I used to call Personal Home Page
PHP is an open source server side scripting language that mainly used for developing web applications and web services.
The PHP is very simple for a beginner, but offers many advanced features for a professional script writer.
Three main areas where PHP scripts are used :
- Server-side scripting
- Command line scripting
- Writing desktop applications
Advantages :
- Open source
- Simple and very easy to learn.
- Support for both structural programming and Object Oriented Programming. Use of variable variables $$var.
- PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, and probably others. PHP has also support for most of the web servers today. This includes Apache, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet servers, Oreilly Website Pro server, Caudium, Xitami, OmniHTTPd, and many others. For the majority of the servers PHP has a module, for the others supporting the CGI standard, PHP can work as a CGI processor.
- One of the most Sexiest feature of PHP is that it can plugin with most of the databases. It support with Adabas D, dBase, Empress, FilePro (read-only), Hyperwave, IBM DB2, Informix, Ingres, InterBase, rontBase, mSQL, Direct MS-SQL, MySQL, ODBC, Oracle (OCI7 and OCI8), Ovrimos, PostgreSQL, SQLite, Solid Sybase, Velocis and Unix dbm
- Power ful built in functions. click here to see all php functions
- PHP also has support services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows)
- PHP has extremely useful text processing features, from the POSIX Extended or Perl regular expressions to parsing XML documents. For parsing and accessing XML documents, PHP 5 standardizes all the XML extensions on the solid base of libxml2 and extends the feature set adding SimpleXML and XMLReader support.
- Easy deployment and cost effective hosting.
Disadvantages :
- Security flaws due to unknown vulnerabilities .
- Not good to create desktop Applications

Asterisk Callme :: The open PBX
Extensions Configuration
extensions.conf
[callme]
exten => s,1,AGI(callme.php|${CNUM})
CNUM is the variable passed to callme AGI Script
Callme.php Agi Script
#!/usr/bin/php
/**
* Author Arun Raj R
* @package phpAGI_for Call me
* @version 1.0
*/
set_time_limit(30);
require_once(“phpagi/phpagi.php”);
$agi = new AGI();
$agi->answer();
$result=$agi->stream_file(“welcome_to_call_me”);
$cid = $argv[1];
$agi->exec(“Dial Zap/g0/”.$cid, null);
?>
PHP File to run callme service request
<?php
require_once(“/var/lib/
asterisk/agi-bin/worker/phpagi/phpagi-asmanager.php”);
$number1=$_REQUEST['num1'];
$number2 = $_REQUEST[num2'];
$asm = new AGI_AsteriskManager();
$asm->connect(“localhost”, “username”, “password”);
$number = “Zap/g0/”.$number1;
$asm->send_request(‘Originate’, array(‘Channel’ => “$number”, ‘Context’ => “callme”, ‘Priority’ => 1, ‘Async’ => true,’callerid’=>”$number1″,’Variable’=>’cnum=’.$number2,
));
$asm->disconnect();?>
Hello All,
Yesterday i was searching for a solution to split large array into small pieces. Suddenly i noticed the that php have a built in function to split array into small pieces. It was very surprise to me ..
Here it is
Function : array array_chunk ( array $input , int $size [, bool $preserve_keys= false ] )
< ?php
$input_array = array('a', 'b', 'c', 'd', 'e');
print_r(array_chunk($input_array, 2));
print_r(array_chunk($input_array, 2, true));
?>
The output will be like this : –
Array
(
[0] => Array
(
[0] => a
[1] => b
)
[1] => Array
(
[0] => c
[1] => d
)
[2] => Array
(
[0] => e
)
)
Array
(
[0] => Array
(
[0] => a
[1] => b
)
[1] => Array
(
[2] => c
[3] => d
)
[2] => Array
(
[4] => e
)
)
Have fun Cheers
Here is the PHP function to calculated duration of “wav” or “GSM” files
First we open file using fopen. After we calculate the size of that file (inbytes) using filesize().
Then we unpack the audio File .
unpack(‘vtype/vchannels/Vsamplerate/Vbytespersec/valignment/vbits’,$rawheader);
This will return following array
Array (
[type] => 1
[channels] => 2
[samplerate] => 44100
[bytespersec] => 176400
[alignment] => 4 [bits] => 16 )
from this array we get bytepersec.
Now it is very easy to find out the duration.. !!
$size_in_bytes/bytespersec.
Code is here.
public static function getDuration($file) {
$fp = fopen($file, ‘r’);
$size_in_bytes = filesize($file);
fseek($fp, 20);
$rawheader = fread($fp, 16);
$header = unpack(‘vtype/vchannels/Vsamplerate/Vbytespersec/valignment/vbits’,
$rawheader);
$sec = ceil($size_in_bytes/$header['bytespersec']);
return $sec;
}
Have fun.
Zend Server
Zend Server is a commercial, enterprise-ready Web Application Server that is designed for running and managing business-critical PHP applications in production. It includes advanced performance optimization, application monitoring and application problem diagnostic capabilities. Zend Server users receive comprehensive technical support, software updates, hot fixes, and security patches.
Packages for Linux,windows and Mac Avalable

Get a free trial license for Zend Server