Witam mam taki kod:

  1. $contents='
  2. <p>Hello {{$username}}, here's a list of all the users:</p>
  3. <div id="accounts">
  4. @if (count($accounts) <= 0):
  5. No accounts found.
  6. @else:
  7. Is account.
  8. </div>';
  9.  
  10.  
  11.  
  12. $contents = preg_replace(
  13. array(
  14. "/{{/",
  15. "/}}\n/",
  16. "/}}/",
  17. "/\[\[/",
  18. "/\]\]/",
  19. '/^\s*@(.*)$/m',
  20. '/\[:\s*block\s(.*)\s*:\](.*)\[:\s*endblock\s*:\]/Usm',
  21. ),
  22. array(
  23. $autoEscape ? "<?php echo 'string'.(htmlspecialchars(" : "<?php echo 'string'.(",
  24. $autoEscape ? ")); ?>\n\n" : "); ?>\n\n",
  25. $autoEscape ? ")); ?>" : "); ?>",
  26. "<?php ",
  27. " ?>",
  28. "<?php \\1 ?>",
  29. "<?php if (array_key_exists('\\1', \$this->inheritBlocks)) { print(\$this->inheritBlocks['\\1']); } else if (\$this->inheritFrom === NULL) { ?>\\2<?php } else { ob_start(); ?>\\2<?php \$this->inheritBlocks['\\1'] = ob_get_contents(); ob_end_clean(); } ?>",
  30. ),
  31. $contents
  32.  
  33. );
  34. return($contents);
  35. }
  36.  


Dostaję coś takiego:

Hello , here's a list of all the users:
No accounts found. Is account.

Czyli w ogole nie zamienia {{}} bo specjalnie dałem tam preg_replace rzed wszystkim slowo "string"
Nie wyświetla if i else ale waruek olewa i wyswietla każdą możliwość