كتابة نص بلغة PHP يقبل قيمة نصية وله 3 وظائف

كتابة نص بلغة PHP يقبل قيمة نصية وله 3 وظائف : 

أ. الأحرف (): إرجاع عدد الأحرف.

ب. الكلمات (): إرجاع عدد الكلمات.

ج. الأسطر (): إرجاع عدد الأسطر.

Write a PHP class "Text" that accept a text value and have 3 methods:
a. characters(): Return the number of characters.
b. words(): Return the number of words.
c. lines(): Return the number of lines.
Usage Example: $text = new Text("This is a dummy text."); $words = $text->words();

الرجاء الإفادة فضلاً 


تأخذ قيمة comment المرسلة من الطلب وننشىء كائن جديد من class السابق ونمرر له قيمة النص ثم نعرض الناتج كالأتي

$text = new Text($_POST["comment"]);

echo 'Characters: '. $text->characters();
echo '<br>';
echo 'Words: '. $text->words();
echo '<br>';
echo 'Lines: '. $text->lines();

بوركت

جزاك الله خيرا على المعلومة