utf 8 - how to concat two strings in php which are in persian -
the question have string of:
$content=$rows["content"];
which retrieved data base.the sting in persian.
want show 150 character.so used:
$content=substr($content,0,150);
and show still continues need show 3 dots: "..." did:
$content.='...';
and when show string echo, 3 dots added appear @ right of last line. persian right left, 3 dots needs appear in left of last line.
i tired 1 two, 1 didn't worked too
$content =iconv(mb_detect_encoding($content, mb_detect_order(), true), "utf-8", $content); $content=substr($content,0,150); $dot='...'; $dot =iconv(mb_detect_encoding($dot, mb_detect_order(), true), "utf-8", $dot); $content.=$dot;
i added p tag rtl around texts wanted shown way. this:
<p dir="rtl">'; echo $content; echo "..."; echo '</p>';
Comments
Post a Comment