How to use pathinfo in php?
问题 I am working on a php code as shown below on which Line#A prints the following array (shown below php code). My code doesn't seems to go inside switch statement. I am not sure why. I added print_r($parts) at Line A in order to print the value of $parts. php code: <?php if (!empty($_POST['id'])) { for($i=0; $i <count($mp4_files); $i++) { if($i == $_POST['id']) { $f = $mp4_files[$i]; $parts = pathinfo($f); print_r($parts); // Line A switch ($parts['extension']) { echo "Hello World"; // Line B