<?php $code = '@if ($user->loggedIn() || true) <p>welcome {{$user->name}}</p> @endif @if (true) <p>hello</p> @endif'; $replacements = array( '/{{(.+?)}}/' => '<?php echo $1; ?>', '/@if\s*\((.+)\)/' => '<?php if ($1): ?>', '/@endif/' => '<?php endif; ?>' ); echo preg_replace(array_keys($replacements), $replacements, $code);
You have javascript disabled. You will not be able to edit any code.