2 variables 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
bst82551
Forum Newbie
Posts: 15
Joined: Wed Dec 29, 2004 12:25 pm
Location: Huntsville, Texas

2 variables together

Post by bst82551 »

I'm trying to make one variable integrate into another, sorta. Well, Ok.

something like this:

Code: Select all

$img + com = $imgcomm;
com is supposed to be a text string added on after $img is shown. The final output if $imgcomm were echoed should be something like this:

image.jpgcom << image.jpg = $img, by the way:-).

Brian
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

bst82551
Forum Newbie
Posts: 15
Joined: Wed Dec 29, 2004 12:25 pm
Location: Huntsville, Texas

more problems

Post by bst82551 »

same script, what's wrong with this code right here?! It's supposed to echo $image.jpg

$image.jpg is in comments.php

Code: Select all

<?php

include 'comments.php';
echo '$&#123;$img&#125;';

?>
Brian
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

single quotes vs. double quotes: single quote strings do not parse variables. Double quote stirngs do.
bst82551
Forum Newbie
Posts: 15
Joined: Wed Dec 29, 2004 12:25 pm
Location: Huntsville, Texas

Post by bst82551 »

never mind... it was a problem with comments.php that i overlooked.

Brian
Post Reply