preg_replace soru

0 Cevap php

Merhaba aşağıdaki yapmaya çalışıyorum:

Ben böyle bir giriş dizesi var demek

{stackoverflow is a {cool|great} website|stackoverflow is the {best|greatest}}. {stackoverflow is for {cool|great} coders|stackoverflow is the {best|greatest} site for coders}

Onu nasıl PHP kullanarak aşağıdaki biçime dönüştürebilirsiniz

{stackoverflow is a [cool|great] website~stackoverflow is the [best|greatest]}. {stackoverflow is for [cool|great] coders~stackoverflow is the [best|greatest] site for coders}

Ben preg_replace ile oynuyorum ama ben çalışan bir çözüm bulamıyor.

To sum things up: The nested { should be turn into [.

Ve | ilk düzeyde ~ çevirmek gerekir.

Herhangi bir fikir?

Selamlar

0 Cevap