Browse Source

Add parse_str() action

master
Adam Backstrom 8 years ago
parent
commit
03aa7169de
  1. 16
      classes.php
  2. 1
      index.php

16
classes.php

@ -202,6 +202,22 @@ class ActionDateC extends AbstractAction
}
}
class ActionParseStr extends AbstractAction
{
public function setUp()
{
$this->setContainer( new DivContainer );
$this->setFormatter( new DbugFormatter );
}
public function decode()
{
parse_str($this->value, $results);
return $results;
}
}
interface ContainerInterface
{
public function wrap( $contents );

1
index.php

@ -46,6 +46,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
<option value="JsonDecode" <?php echo selected($action_str, 'JsonDecode'); ?>>json_decode()</option>
<option value="JsonEncode" <?php echo selected($action_str, 'JsonEncode'); ?>>json_encode()</option>
<option value="DateC" <?php echo selected($action_str, 'DateC'); ?>>date('c', $timestamp)</option>
<option value="ParseStr" <?php echo selected($action_str, 'ParseStr'); ?>>parse_str()</option>
<select>
<input type="submit">
</form>

Loading…
Cancel
Save