ConFoo Montreal 2026: Call for Papers

Voting

: max(five, one)?
(Example: nine)

The Note You're Voting On

buuh
14 years ago
if you want to extract all {token}s from a string:

<?php
$pattern
= "/{[^}]*}/";
$subject = "{token1} foo {token2} bar";
preg_match_all($pattern, $subject, $matches);
print_r($matches);
?>

output:

Array
(
[0] => Array
(
[0] => {token1}
[1] => {token2}
)

)

<< Back to user notes page

To Top