Problem putting numbers together

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

Problem putting numbers together

Post by Jose Arce »

Hi, i'm making a script...and i need that a number, ip format (like this 255.255.255) joins another number to be like this: 255.255.255.255
The problem is that i do not know how to do that...i'm trying this way:

Code: Select all

$ip = $ip1.$ip2
that doesn't work...can u help me?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try

Code: Select all

<?php $ip = "$b1.$b2.$b3.$b4"; >?
a dot outside of a string ('string' or "string") is parsed as the concatenation operator
Last edited by volka on Sat Jun 01, 2002 9:25 pm, edited 1 time in total.
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

Post by Jose Arce »

thx man :D
Post Reply