sukhjit dhot
sukhjit dhot

Reputation: 353

how to treat dot as a dot and not as a dot operator in php

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

Answers (3)

vinu
vinu

Reputation: 11

Try this

 <?php
 $ip = gethostbyname('www'.'.'.($_GET['ip']).'.'com');
 ?>

Upvotes: 1

Fracsi
Fracsi

Reputation: 2314

String concatenation:

$ip = gethostbyname('www.'.($_GET['ip']).'.com');

Upvotes: 0

Nil&#39;z
Nil&#39;z

Reputation: 7475

Try this:

<?php
     $ip = gethostbyname('www.'.($_GET['ip']).'.com');
?>

Upvotes: 4

Related Questions