Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1f59980

Browse files
committed
1108
1 parent be0166c commit 1f59980

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
class Solution
3+
{
4+
/**
5+
* @param String $address
6+
* @return String
7+
*/
8+
public function defangIPaddr($address)
9+
{
10+
return str_replace('.','[.]',$address);
11+
}
12+
}
13+
14+
$solution = new Solution();
15+
16+
$address = "1.1.1.1";
17+
18+
$defangedAddress = $solution->defangIPaddr($address);
19+
20+
echo $defangedAddress;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /