From b5d2a1f08c61dde1a530b7f04cbfc91521eb1e99 Mon Sep 17 00:00:00 2001 From: Sarvar <56576654+sarvar-akbarov@users.noreply.github.com> Date: Sat, 1 Jul 2023 10:30:05 +0500 Subject: [PATCH] Added solution in PHP language --- solutions/029.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/solutions/029.md b/solutions/029.md index 890c6a1..3b53640 100644 --- a/solutions/029.md +++ b/solutions/029.md @@ -70,4 +70,22 @@ class Solution: explnation_here +#### PHP + +```php +class Solution { + + /** + * @param String[] $sentences + * @return Integer + */ + function mostWordsFound($sentences) { + $maxNumberOfWords = 0; + foreach($sentences as $sentence){ + $maxNumberOfWords = max($maxNumberOfWords, str_word_count($sentence)); + } + return $maxNumberOfWords; + } +} +``` ***NB***: If you want to get community points please suggest solutions in other languages as merge requests.