File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,25 @@ public class Solution {
218
218
}
219
219
```
220
220
221
+ ### ** PHP**
222
+
223
+ ``` php
224
+ class Solution {
225
+ /**
226
+ * @param String $s
227
+ * @return String
228
+ */
229
+ function replaceSpace($s) {
230
+ $rs = "";
231
+ for ($i = 0; $i < strlen($s); $i++) {
232
+ if ($s[$i] === " ") $rs = $rs."%20";
233
+ else $rs = $rs.$s[$i];
234
+ }
235
+ return $rs;
236
+ }
237
+ }
238
+ ```
239
+
221
240
### ** ...**
222
241
223
242
```
Original file line number Diff line number Diff line change
1
+ class Solution {
2
+ /**
3
+ * @param String $s
4
+ * @return String
5
+ */
6
+ function replaceSpace ($s ) {
7
+ $rs = " " ;
8
+ for ($i = 0 ; $i < strlen ($s ); $i ++ ) {
9
+ if ($s [$i ] === " " ) $rs = $rs . " %20" ;
10
+ else $rs = $rs . $s [$i ];
11
+ }
12
+ return $rs ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments