All fields

“File Handling & File System Functions” in Information Technology

18 questions across 1 technology.

Information Technology

18 questions in 1 technology

#QuestionTechnologyTopicLevel
1What security risks are associated with file handling operations that involve user supplied file paths, and how does path traversal attack prevention work? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsAdvanced
2How do you read the contents of a file in PHP using functions like file_get_contents and fopen? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsBeginner
3How do stream wrappers and stream contexts in PHP allow file functions to work seamlessly with non local resources like remote URLs or cloud storage? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsAdvanced
4How do you check whether a file or directory exists, and how do you retrieve useful metadata like a file's size or last modified time? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsIntermediate
5How do you write data to a file in PHP, and what is the difference between overwriting a file and appending to it? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsBeginner
6How do file locking mechanisms in PHP, using the flock function, help prevent data corruption when multiple processes might write to the same file concurrently? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsIntermediate
7How do you work with directories in PHP, including listing their contents, creating new directories, and recursively deleting them? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsIntermediate
8How do you move an uploaded file from its temporary location to a permanent storage location using move_uploaded_file? PHP › File Upload HandlingPHPFile Upload HandlingBeginner
9How should you validate an uploaded file's type and size before accepting it, and why is checking only the file extension considered insufficient for security? PHP › File Upload HandlingPHPFile Upload HandlingIntermediate
10How do you control the depth and formatting of json_encode output, such as pretty printing JSON for readability or handling deeply nested data structures? PHP › JSON Handling in PHPPHPJSON Handling in PHPIntermediate
11How does recursion work in PHP functions, and what are the practical considerations, such as stack depth limits, when writing a recursive function? PHP › Functions & ScopePHPFunctions & ScopeAdvanced
12How can you efficiently parse an extremely large XML file that would be too large to comfortably load entirely into memory at once, using a streaming based approach like XMLReader? PHP › XML Handling in PHPPHPXML Handling in PHPAdvanced
13How does the finally block work alongside try and catch, and what are appropriate use cases for it? PHP › Error & Exception HandlingPHPError & Exception HandlingIntermediate
14How does the DOM extension provide a more powerful and flexible alternative to SimpleXML when you need to actually modify or construct an XML document rather than only read one? PHP › XML Handling in PHPPHPXML Handling in PHPIntermediate
15What performance considerations arise when working with very large JSON payloads in PHP, and how do streaming JSON parsers help address them? PHP › JSON Handling in PHPPHPJSON Handling in PHPAdvanced
16What is a generator in PHP, and how does the yield keyword let a function produce a sequence of values without building an entire array in memory at once? PHP › Generators & IteratorsPHPGenerators & IteratorsBeginner
17How do you access command line arguments passed to a PHP script using the $argv and $argc superglobals? PHP › PHP CLI ScriptingPHPPHP CLI ScriptingBeginner
18How does preg_split let you break a string apart into an array using a regular expression as the delimiter, and how does this differ from PHP's simpler explode function? PHP › Regular Expressions in PHPPHPRegular Expressions in PHPIntermediate