22, 'b' => 42 ) ); // create a db with field list ("fdt") $db = new Isis_Db( array( 'title' => 24, 'author' => 70, 'keywords' => 69 ), 'cds' ); // a special value using lotsa subfields with the traditional sep ^ $subs = 'initial^aParis^bUnesco^b^c-1965'; // create record using various add parameters $r = new Isis_Rec( // set the db '-db', $db, // first some lines from CDS, some using field names, some plain int tags 'keywords', 'Paper on: ', 'author', 'Magalhaes, A.C.', 24, ' Controlled climate in the plant chamber', 76, 'Les Politiques de la communication en Yougoslavie^zfre', 'author', 'Franco, C.M.', 26, $subs, // a field to test del 77, 'ave Caesar', // a field using tab as subfield separator 42, "foo\tbar\tbaz", // a field containing newline 99, "two\nlines", // a serialized record (as of toString) as parameter "70\tyet another author\n99two more\n\tlines\na 0 field\n42\tthe\tanswer" ); // dump the stuff ?>

dump of record

have len()?> fields
--
toString())?>--

examples of field selector

tag); // print_r corrupts data with 4.3.1 // print_r($r->map()); $r->del( 77 ); // ... morituri te salutant // various examples how to access fields foreach ($db->fdt as $name => $tag) while ($v = $r->mhl($tag)) echo "$name = $v
\n"; ?> v26^a = h(26,'^a')?>
res(); // more convenient to get them all at once // the same as Isis_rec::fmt($r->v(26),'&^abc'), foreach ($r->h(26,'^abc') as $k => $v) echo "v26^$k = $v
\n"; ?> v69 = mhl('keywords')?>
v76 = mhl(76)?>
v42(1) = h(42,'(1)')?> formats returning arrays on '$subs'\n"; foreach (array( '&^cab(..', '&^*(..', '&^(..', '&^bca(1..', '&MHL^cab(..' ) as $fmt) { echo "\n\n

Format "$fmt"

\n"; foreach (Isis_rec::fmt($subs,$fmt) as $k => $v) echo "v26^$k = $v
\n"; } ?>

embedding and TEXT mode

embed( 22, $r ); $s = $q->toString(ISIS_REC_TEXT); echo "

record embedded as field 22

\n
---\n$s---\n
\n"; $q->del(); // restore from the string $q->parse( $s, ISIS_REC_TEXT ); // extract the original r $r = $q->v( 22, 0 ); $r->db = $db; echo "

record restored from field 22

\n", "
---\n", $r->toString(), "---\n
\n"; ?>

set operator

set( 'title', 'new title', 'second new title' ); // change 99s, removing one $r->set( 99, 'now a oneliner' ); // change author[1] only, also test array parameter $r->set( 'author', array(1, 'Blanco', 0) ); echo "
---\n", $r->toString(), "---\n
\n"; ?>

talking to echo server

Unfortunately, PHP GET/POST based echo server can not preserve field order. request( $r ); if ( $res ) echo "\n
---\n", $res->toString(), "---
\n"; else echo "failed\n"; ?>