Hetymine

Code worth dying for!

You are not logged in.

  • Index
  • » Lua Scripts
  • » Convert a whitespace or comma separated list of words into a PHP array

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/toroadmin/hetymine/include/parser.php on line 802

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/toroadmin/hetymine/include/parser.php on line 802

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/toroadmin/hetymine/include/parser.php on line 802

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/toroadmin/hetymine/include/parser.php on line 802

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/toroadmin/hetymine/include/parser.php on line 802

#1 2010-07-27 19:07:36

duck-typing
The Programmer

Convert a whitespace or comma separated list of words into a PHP array

Download: php.lua

Say you copy the headers of a database table in PHPMyAdmin to the clipboard giving you "id title content author". Executing the command php array will generate:

array(
    "id" => "",
    "title" => "",
    "content" => "",
    "author" => ""
);

Alternatively, executing the command php array -v will generate:

array("id", "title", "content", "author");

Offline

  • Index
  • » Lua Scripts
  • » Convert a whitespace or comma separated list of words into a PHP array

Board footer

Powered by FluxBB