Jonathan
05-23-2006, 07:10 PM
function ident($spaces = 3, $char = " ") {
while ( $position < $spaces) {
$rtn .= $char;
$position++;
}
return $rtn;
}
when called, it returns the second parameter x amount of times (let x = first param)
Basically if i did
<? echo ident(2); ?>
it would return two spaces... Kind of useful if you don't want to get lost in a horde of <blockquote>s
Here is a real-life application of my function, as used on team357.org
echo ident(3) . "Adding to mySQL Database Server<br />\n";
$insertquery=mysql_query2("INSERT INTO `udhs_gal_cats` (`ID`, `name`, `parent`, `dir`, `addedby`) VALUES('', '$file', '$category', '$filtered_path' , '$uinfo_userid')");
echo ident(6) . "mySQL Database Updated<br />\n";
echo ident(3) . "Renaming Folder to <i>$file_filtered</i><br />\n";
$rename = rename($pre_path, $filtered_path);
echo ident(6) . "Rename Successful<br />\n";
echo ident(6) . "Restored Permissions<br />\n";
system("chgrp team357 $file", $chgr2);
while ( $position < $spaces) {
$rtn .= $char;
$position++;
}
return $rtn;
}
when called, it returns the second parameter x amount of times (let x = first param)
Basically if i did
<? echo ident(2); ?>
it would return two spaces... Kind of useful if you don't want to get lost in a horde of <blockquote>s
Here is a real-life application of my function, as used on team357.org
echo ident(3) . "Adding to mySQL Database Server<br />\n";
$insertquery=mysql_query2("INSERT INTO `udhs_gal_cats` (`ID`, `name`, `parent`, `dir`, `addedby`) VALUES('', '$file', '$category', '$filtered_path' , '$uinfo_userid')");
echo ident(6) . "mySQL Database Updated<br />\n";
echo ident(3) . "Renaming Folder to <i>$file_filtered</i><br />\n";
$rename = rename($pre_path, $filtered_path);
echo ident(6) . "Rename Successful<br />\n";
echo ident(6) . "Restored Permissions<br />\n";
system("chgrp team357 $file", $chgr2);