satishgaudo.com

Understanding technology

Archive for June 15th, 2009

Function to get the recursive folder structure of the destionation folder

/** * getDirStructure * get the recursive folder structure of the destionation folder * @param string $path folder path * @param array array resultant folders and files * @access public */ public function getDirStructure($path, &$a, $sOriginalZipFilepath){ $aDir=array(); $aFiles=array(); $nd=0; $nf=0; $hndl=opendir($path); while($file=readdir($hndl)){ if ($file ==’.’ || $file==’..’) continue; if (is_dir($path.’/’.$file)){ $aDir[$nd++]=$file; } else{ $aFiles[$nf++]=$file; } } closedir($hndl); $n=1; for ($i=0;$i<count($aDir);$i++){ $this->getDirStructure($path.’/’.$aDir[$i].’/', $a[$n]); $a[$n++][0]=str_replace("//","/",$path.$aDir[$i]); } for ($i=0;$i<count($aFiles);$i++){ $a[$n++]=str_replace("//","/",$path.$aFiles[$i]); } }

15 June 2009 at 20:24 - Comments
twmujczf at 23:50 on 14 July 2009
thanks . i was searching for this code
Vaibhav at 11:20 on 29 January 2010
Hi Satish, Good work dude ...

Example script for exexuting an mssql stored procedure in php

$package_code = ‘AUS03B’; $client_id = 499; $conn = odbc_connect(DSN,USER,PASS,SQL_CUR_USE_ODBC); //SQL_CUR_USE_IF_NEEDED,SQL_CUR_USE_ODBC ,SQL_CUR_USE_DRIVER SQL_CUR_DEFAULT $sql_result = odbc_prepare($conn, "EXEC usp_packagesearch_xml ‘$package_code’,'$client_id’"); $result = odbc_execute($sql_result); //$string = odbc_result($sql_result,1); $string = odbc_result_all($sql_result,"border=1");

15 June 2009 at 20:22 - Comments