please help for arranging vars

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
Sparta
Forum Newbie
Posts: 3
Joined: Sun Oct 05, 2008 4:45 am

please help for arranging vars

Post by Sparta »

hello mates

funny problem for a newbie but please help:
I have 4 vars and all are numeric, I want to make the 5th var as an arrangement of these and can't do it.
for example:
$a = 111;
$b = 222;
$c = 333;
$d = 444;
I want result to be:
$result = $a.$b.$c.$d but not work, I want the result as the below:
$result = 111222333444;
but any combination I use made them multiple to each other or goes to mathematics commands.
what I must to have the result?
User avatar
pcoder
Forum Contributor
Posts: 230
Joined: Fri Nov 03, 2006 5:19 am

Re: please help for arranging vars

Post by pcoder »

What did you get then? :)
Sparta
Forum Newbie
Posts: 3
Joined: Sun Oct 05, 2008 4:45 am

Re: please help for arranging vars

Post by Sparta »

I didn't get anything friend
I need help here not lough
help me how arrange $a $b $c $d
that the output would be a string like my sample
$result = 111222333444;
is it work:
$result = {$a}.{$b}.{$c}.{$d}
or anything else
pleaseeeeeeeeeeeee

Best Regards
Sparta
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: please help for arranging vars

Post by Ziq »

How is it possibly :)

Try this:

Code: Select all

<?
$a = 111;
$b = 222;
$c = 333;
$d = 444;
$result = $a.$b.$c.$d;
echo 'result is '.$result;
?>
What are you geting in output?
Sparta
Forum Newbie
Posts: 3
Joined: Sun Oct 05, 2008 4:45 am

Re: please help for arranging vars

Post by Sparta »

I don't know why you make joke with me

I said I don't know how to do it if you have any idea please help if not don't make fun here please.
I only said if we have:
$a=111;
$b=222;
$c=333;
$d=444;
how I can have:
$result=111222333444;
I know for you this is really funny but I can't do it and need your help M8s
please help
I just want to set this numeric variables one after another and no action on them just puting one after another no calculation.
4fit?
Forum Newbie
Posts: 6
Joined: Sat Oct 04, 2008 9:37 am
Location: Graham, NC

Re: please help for arranging vars

Post by 4fit? »

Sparta wrote:I don't know why you make joke with me

I said I don't know how to do it if you have any idea please help if not don't make fun here please.
I only said if we have:
$a=111;
$b=222;
$c=333;
$d=444;
how I can have:
$result=111222333444;
I know for you this is really funny but I can't do it and need your help M8s
please help
I just want to set this numeric variables one after another and no action on them just puting one after another no calculation.
Dude, chill a bit. Zig just provided you with the answer with the code below. You can see by this sample page that it produces exactly what you want.

Code: Select all

<?
$a = 111;
$b = 222;
$c = 333;
$d = 444;
$result = $a.$b.$c.$d;
echo 'result is '.$result;
?>
Post Reply