Reputation: 353
is there any way to do this in php.i know php treat . as a concatenation operator but i want to force php to treat as a dot when placed between strings
like this
<?php
error_reporting(0);
$ip = gethostbyname(www.($_GET['ip']).com);
<input type="text" id="ip" name="ip" >
it displays a result
wwwexamplecom
instead i want it like this
www.example.com
i am still a beginner so soory if my question sound too noobish
Upvotes: 0
Views: 92
Reputation: 11
Try this
<?php
$ip = gethostbyname('www'.'.'.($_GET['ip']).'.'com');
?>
Upvotes: 1
Reputation: 2314
String concatenation:
$ip = gethostbyname('www.'.($_GET['ip']).'.com');
Upvotes: 0
Reputation: 7475
Try this:
<?php
$ip = gethostbyname('www.'.($_GET['ip']).'.com');
?>
Upvotes: 4