How do I supply a variable to put in a another variable in PHP?

Posted by Jared on Stack Overflow See other posts from Stack Overflow or by Jared
Published on 2010-03-17T16:12:15Z Indexed on 2010/03/17 16:21 UTC
Read the original article Hit count: 225

Filed under:
|

I'm not sure if I asked the question correctly.

I have some code I am trying to embed. For instance:

$menuPopup ='<IMG SRC="' . $someVariable . '">';

Later on, I have the a few product variables:

$someProduct1 ='image1.jpg';
$someProduct2 ='image2.jpg';

Later on, want to display the $menuPopup, using a src from $someProduct1, or $someProduct2.

//Pseudo Code

$menuPopup ( $someProduct1);

Anyway to do that?

© Stack Overflow or respective owner

Related posts about php

Related posts about variable