From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- ext/spl/examples/dba_array.php | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 ext/spl/examples/dba_array.php (limited to 'ext/spl/examples/dba_array.php') diff --git a/ext/spl/examples/dba_array.php b/ext/spl/examples/dba_array.php new file mode 100755 index 0000000..346ac1f --- /dev/null +++ b/ext/spl/examples/dba_array.php @@ -0,0 +1,52 @@ + \ \ [\] + * + * If \ is specified then \ is set to \ in \. + * Else the value of \ is printed only. + * + * Note: configure with --enable-dba + */ + +if ($argc < 4) { + echo << [] + +If is specified then is set to in . +Else the value of is printed only. + + +EOF; + exit(1); +} + +if (!class_exists("DbaReader", false)) require_once("dbareader.inc"); + +try { + if ($argc > 2) { + $dba = new DbaArray($argv[1], $argv[2]); + if ($dba && $argc > 3) { + if ($argc > 4) { + $dba[$argv[3]] = $argv[4]; + } + var_dump(array('Index' => $argv[3], 'Value' => $dba[$argv[3]])); + } + unset($dba); + } + else + { + echo "Not enough parameters\n"; + exit(1); + } +} +catch (exception $err) { + var_dump($err); + exit(1); +} +?> \ No newline at end of file -- cgit v1.2.1