Skip to content

Instantly share code, notes, and snippets.

@dev-jaydeep
Created March 24, 2023 10:46
Show Gist options
  • Save dev-jaydeep/3ce99fe6311d457fd128e793bc01f451 to your computer and use it in GitHub Desktop.
Save dev-jaydeep/3ce99fe6311d457fd128e793bc01f451 to your computer and use it in GitHub Desktop.
Find all words in double curly braces from given string using php
<?php
$string = 'This is a {{ sample }} string with {{ curly }} brace';
preg_match_all('/\{{([^}]*)\}}/', $string, $matches);
print_r($matches[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment