
Originally Posted by
Nightwalker83
@Shohas_ifas,
If you want someone to convert the code for you, you need to first explain to us what the function and purpose of the original code is such as KGComputers asked. There may even be ASP.NET code that have already been written to do what you require so if you post the function and purpose of the code in post #1 we could find the asp.net equivalent for you.
thanks a lot for your reply sir..
Please see below code instead, i have commented it, hope this will help you to understand the code purpose
PHP Code:
<?php
$strFilesArray = glob('../*'); // get all files list into array of parent folder. example if script file is in "sample\test\test.php" it will get all files form the sample folder.
$strData =''; //variable to store results
foreach($strFilesArray as $strFile) //loop through all items in the array
{
if(is_file($strFile)) // check if current item in the loop is file or folder. If file proceed
{
$strData = $strData . basename($strFile) . '//' . rawurlencode(basename($strFile)) . '//' . filesize($strFile) . "\r\n";
/*
store the result in the variable
in php . means & (Concatenate/join)
basename($srfile) = it returns only the file name with extension ; resource = http://php.net/manual/en/function.basename.php
rawurlencode($strfile) = it convert the plain text to urlencdoed text; resource = http://php.net/manual/en/function.rawurlencode.php
filesize($strFile) = get the file size in bytes; resource = http://php.net/manual/en/function.filesize.php
"\r\n" = new line (cr and lf) in vb.net it is environment.newline
*/
}
}
if($strData == '')
{
$strData = 'No Files Found!'; // if not files found then this statements carried out
}
echo $strData; //export/render the data to user/browser
?>
thanks in advance
best regards