Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SimpleDir - Directory listing plugin
#15
I randomly found this also in the php.net docs for str_getcsv

Code:
xoneca at gmail dot com 26-Nov-2011 09:26
Note that this function can also be used to parse other types of constructions. For example, I have used to parse .htaccess AddDescription lines:

    AddDescription "My description to the file." filename.jpg

Those lines can be parsed like this:

<?php

$line = 'AddDescription "My description to the file." filename.jpg';

$parsed = str_getcsv(
    $line, # Input line
    ' ',   # Delimiter
    '"',   # Enclosure
    '\\'   # Escape char
);

var_dump( $parsed );

?>

The output:

array(3) {
  [0]=>
  string(14) "AddDescription"
  [1]=>
  string(27) "My description to the file."
  [2]=>
  string(12) "filename.jpg"
}

These 2 features would be awesome, header and description support.

Also it would be nice if this plugin supported function calls with folder, so it can be used multiple times as a component or a inline shortcode.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
SimpleDir - Directory listing plugin - by RobA - 2011-11-02, 01:37:02
SimpleDir - Directory listing plugin - by jyoz22 - 2011-11-02, 03:42:34
SimpleDir - Directory listing plugin - by mvlcek - 2011-11-02, 04:06:50
SimpleDir - Directory listing plugin - by RobA - 2011-11-02, 05:04:27
SimpleDir - Directory listing plugin - by mvlcek - 2011-11-02, 05:47:53
SimpleDir - Directory listing plugin - by RobA - 2011-11-03, 03:55:45
SimpleDir - Directory listing plugin - by RobA - 2011-11-06, 07:35:47
SimpleDir - Directory listing plugin - by RobA - 2011-11-06, 07:37:52
SimpleDir - Directory listing plugin - by shawn_a - 2011-12-09, 07:44:51
SimpleDir - Directory listing plugin - by RobA - 2011-12-09, 09:22:33
SimpleDir - Directory listing plugin - by shawn_a - 2011-12-10, 01:01:54
SimpleDir - Directory listing plugin - by RobA - 2011-12-10, 04:49:42
SimpleDir - Directory listing plugin - by shawn_a - 2011-12-13, 03:54:57
SimpleDir - Directory listing plugin - by shawn_a - 2012-06-06, 04:17:01
SimpleDir - Directory listing plugin - by maxpop - 2012-08-21, 04:24:56
SimpleDir - Directory listing plugin - by RobA - 2012-08-23, 03:35:45
SimpleDir - Directory listing plugin - by chaos - 2012-09-15, 17:12:46
SimpleDir - Directory listing plugin - by RobA - 2012-09-17, 01:19:26



Users browsing this thread: 1 Guest(s)