Skip to content

Commit

Permalink
update examples in README
Browse files Browse the repository at this point in the history
  • Loading branch information
apemsel committed Feb 21, 2016
1 parent a7b08ab commit 87f7e67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ A class to work with attributed strings in PHP. Attributed strings are strings t

$as->setPattern("/[aeiou]/", "vowel"); // vowels have attribute "vowel"
$as->getAttributes(12); // char at offset 12 has attributes ["color", "vowel"]

$as->combineAttributes("and", "color", "vowel", "colored-vowel"); // also use "or", "not", "xor" to combine attributes
$as->is("colored-vowel", 12); // "o" of "brown" is a color vowel ;-)

$as->setSubstring("fox", "noun"); // all instances of "fox" have attribute "noun"
$as->is("noun", 16); // true, char at offset 16 is part of a noun
Expand Down

0 comments on commit 87f7e67

Please sign in to comment.