Jump to content

ARITABACAN

New Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ARITABACAN

  • Rank
    Newbie
  1. If i using preg_replace('/['.$fonts.']/i', '<b>$1</b>', $text); The result will be like this, right? a iKo SaioT eeee but if you click right and inspect. You can see <b>a</b> <b>i</b>K<b>o</b> S<b>a</b><b>i</b><b>o</b>T <b>e</b><b>e</b><b>e</b><b>e</b> Being separated by spaces But different from using ^$fonts![:space:] To be <b>a</b> <b>i</b>K<b>o</b> S<b>aio</b>T eeee Why i using exeption space? Cause Arabic script is continuous If using ^$fonts![:space:] to be like <b>مَنْ جَاءَ بِا</b> If not <b>م</b><b>َ</b><b>ن</b><b>ْ</b> <b>ج</b><b>َ</b><b>ا</b><b>ء</b><b>َ</b> <b>ب</b><b>ِ</b><b>ا</b> Not same مَ نْ جَ اءَ بِ ا = مَنْ جَاءَ بِا But this problem, like my question in post Why the last eeee letter does not change bold? And when $text = "a" The result does not turn into bold too.
  2. I have two questions, first <?php $text = "a iKo SaioT eeee"; $fonts = "a|i|u|e|o"; $newText = preg_replace("#([$fonts].+?(?=[^$fonts![:space:]]))#us", '<b>$1</b>', $text); echo $newText; ?> Will be like (a iKo SaioT eeee). Not (a iKo SaioT eeee). Why the last eeee letter does not change bold? And when $text = "a" The result does not turn into bold too. I need without space too. Because if I put space in array a|i|u|e|o|[:space:]. It will be like this <b>e</b><b>e</b><b>e</b><b>e</b> will be separate. And if i using #([$fonts]?(?=[^$fonts![:space:]]))#us without .+, first and last, fonts not being bold Second, how to convert this code into jquery $newText = preg_replace("#([$fonts].+?(?=[^$fonts![:space:]]))#us", '<b>$1</b>', $text); Cause $fonts is arrays not same in php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.