We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f553e18 commit 287f23aCopy full SHA for 287f23a
Easy/520. Detect Capital/solution.php
@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+class Solution {
4
5
6
+ // @param String $word
7
+ // @return Boolean
8
+ function detectCapitalUse($word) {
9
10
+ $value = strlen($word);
11
+ //echo $value;
12
13
+ if($value ==1){
14
+ return true;
15
+ }else if($value >1){
16
17
+ if(ctype_upper($word)){
18
+ return true ;
19
+ }else{
20
21
+ return false;
22
+ }
23
24
+ else{
25
+ for ($i = 1; $i < $value; $i++){
26
+ if($word[$i]== $word[1]){
27
28
29
30
31
32
33
34
35
36
37
38
+}
39
40
41
+$solution = new Solution();
42
+$solution->detectCapitalUse("FlaG");
43
44
+?>
0 commit comments