Skip to content

Instantly share code, notes, and snippets.

@aligundogdu
Created January 31, 2014 09:26
Show Gist options
  • Save aligundogdu/8728938 to your computer and use it in GitHub Desktop.
Save aligundogdu/8728938 to your computer and use it in GitHub Desktop.
<?php
$metin = "{{<strong>selami</strong><br/>}}askldjakldjadkljas{{şahin}}"; //İlk Deneme
$metin = '{{</w:t></w:r><w:proofErr w:type="gramStart"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>Sinif.isim</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>}}'; //Orj
$metin = '{{isim}} {{</w:t></w:r><w:proofErr w:type="gramStart"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>Sinif.isim</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>}}'; //Son
echo $metin;
$metin = preg_replace('/<[^>]*>/', '', $metin); //Regex ile diret stip tags
preg_match_all("/\{\{(.*)\}\}/USi", $metin, $array);
print_r($array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment