Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

اعداد برعکس #13

Open
Sasanmaghami opened this issue Jun 15, 2024 · 3 comments
Open

اعداد برعکس #13

Sasanmaghami opened this issue Jun 15, 2024 · 3 comments

Comments

@Sasanmaghami
Copy link

سلام و تکشر بابت زحمات شما. دوست عزیز در زمان استفاده از PersianRender اعداد به صورت برعکس نوشته می شوند.
مثلا 123 می شود 321.
لطفا راهنمایی می فرمایید؟
با تشکر

@mahmoud-eskandari
Copy link
Owner

بله این مشکل وجود داره ولی من ۶سالی میشه php کد نمیزنم باید بشینم به حوصله بررسی کنم.
میتونید با regex اعداد رو جدا کنید و فقط قسمتهای فارسی رو بدید به کتابخونه براتون تبدیل کنه.

@mahmoud-eskandari
Copy link
Owner

این رو خودتون میتونید تکمیل کنید

$re = '/([^[:ascii:]]*)/mu';
$str = 'فارسی23234dfgesrtgre345345435';

preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);

// Print non ascii (~ Persian charachters)
var_dump($matches);

@Sasanmaghami
Copy link
Author

خیلی ممنونم ازینکه وقت گذاشتین و راهنمایی فرمودین. فعلا با strrev برعکس می کنم اعداد رو درست می شوند . اگر دیدم strrev بعضی جا ها جواب نمیده از راه حل پیشنهادی شما استفاده می کنم. متشکرم ازتون

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants