Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
i'm trying to make a jason of the files and there size, its working perfectly for the directory that this php file is saved in but when i change the directory the filesize() returns false. this works fine:
php header('Content-Type: application/json'); $dir= "./"; //path $com/tag/list">list = array(); //main array if(is_dir($dir)){ if($dh = opendir($dir)){ while(($file = readdir($dh)) != false){ if($file == "." or $file == ".."){ //... } else { //create object with two fields $com/tag/list">list3 = array( 'file' => $file, 'size' => com/tag/files">filesize($file)); array_push($com/tag/list">list, $com/tag/list">list3); } } } $return_array = array('com/tag/files">files'=> $com/tag/list">list); com/tag/echo">echo json_encode($return_array); } ?>
but this doesn't work:
php header('Content-Type: application/json'); $dir= "Syllabus/Undergraduate Courses/BCA/Semester 1"; //path $com/tag/list">list = array(); //main array if(is_dir($dir)){ if($dh = opendir($dir)){ while(($file = readdir($dh)) != false){ if($file == "." or $file == ".."){ //... } else { //create object with two fields $com/tag/list">list3 = array( 'file' => $file, 'size' => com/tag/files">filesize($file)); array_push($com/tag/list">list, $com/tag/list">list3); } } } $return_array = array('com/tag/files">files'=> $com/tag/list">list); com/tag/echo">echo json_encode($return_array); } ?>
error message: Warning: filesize(): stat failed for Communicat_GeneralEnglish1stSemsterCopyCopy2Copy.pdf in C:\xampp\htdocs\college\com/tag/list">listFiles.php on line 17Warning: filesize(): stat failed for Environmental Studies_AECC-Environment-Studies-BCA.pdf in C:\xampp\htdocs\college\com/tag/list">listFiles.php on line 17Warning: filesize(): stat failed for Foundation Course On Computers_B.CA_.pdf in C:\xampp\htdocs\college\com/tag/list">listFiles.php on line 17Warning: filesize(): stat failed for Fundamentals Of Mathematics_B.CA_.3.pdf in C:\xampp\htdocs\college\com/tag/list">listFiles.php on line 17Warning: filesize(): stat failed for Problem Solving And Programming With C_B.CA_.2.pdf in C:\xampp\htdocs\college\com/tag/list">listFiles.php on line 17{"files":[{"file":"Communicat_GeneralEnglish1stSemsterCopyCopy2Copy.pdf","size":"0 bytes"},{"file":"Environmental Studies_AECC-Environment-Studies-BCA.pdf","size":"0 bytes"},{"file":"Foundation Course On Computers_B.CA_.pdf","size":"0 bytes"},{"file":"Fundamentals Of Mathematics_B.CA_.3.pdf","size":"0 bytes"},{"file":"Problem Solving And Programming With C_B.CA_.2.pdf","size":"0 bytes"}]}
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.