Viewed   79 times

I am trying to get an HTML-based recursive directory listing based on code here:

http://webdevel.blogspot.in/2008/06/recursive-directory-listing-php.html

Code runs fine but it throws some errors:

Strict Standards: Only variables should be passed by reference in C:xampphtdocsdirectory5.php on line 34

Strict Standards: Only variables should be passed by reference in C:xampphtdocsdirectory5.php on line 32

Strict Standards: Only variables should be passed by reference in C:xampphtdocsdirectory5.php on line 34

Below is the excerpt of code:

else
  {
   // the extension is after the last "."
   $extension = strtolower(array_pop(explode(".", $value)));   //Line 32

   // the file name is before the last "."
   $fileName = array_shift(explode(".", $value));  //Line 34

   // continue to next item if not one of the desired file types
   if(!in_array("*", $fileTypes) && !in_array($extension, $fileTypes)) continue;

   // add the list item
   $results[] = "<li class="file $extension"><a href="".str_replace("\", "/",     $directory)."/$value">".$displayName($fileName, $extension)."</a></li>n";
  }

 Answers

1

This should be OK

   $value = explode(".", $value);
   $extension = strtolower(array_pop($value));   //Line 32
   // the file name is before the last "."
   $fileName = array_shift($value);  //Line 34
Tuesday, November 22, 2022
4

for the time being I'm avoided using wp_oembed_get altogether by swopping my conditionals and if its not an iframe or using the following which seems to determine whether its a locally hosted, or oembed link automagically....

global $wp_embed;
$post_embed = $wp_embed->run_shortcode('[embed]'.$url.'[/embed]');

and then echo'ing $post_embed

Saturday, September 17, 2022
 
pt2ph8
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :