在fpdf中使用图像中的变量

I'm having an problem. please bear with me i'm new at this stuff. Here is what's happening. i want to add an image that i uploaded from php. in my php i am giving the image a random name ( giving it an order number ). the upload of the image works fine and i am getting the name i want. my problem comes in when i go to generate an pdf. in my pdf i am requesting that same (order number which i used to generate the name of the image) as a variable from my mysql and if i echo that to the screen it seems to be correct aswell. my problem is when i want to use that variable in an image in my pdf. here is my code.

//this is my order number

$pro_forma_number=$_SESSION['orderpro'];

//this is the output of the pro_forma_number

MAG132

// this is the image name

MAG132.jpg

//this is the image in the pdf

$pdf->Image('LALOGO.png',-1,-1,212); 

$pdf->Image('./upload_images/$pro_forma_number.jpg',50,50,10,);

the top one works fine but i suspect that is because i am giving it the exact file name.

i know this works if you do this..

// image directory

$imagedir=('./upload_images/MAG132.jpg');

// pdf image

$pdf->Image('$imagedir',50,50,10,);

but i have alot of images with different names and i want to invoke only the images related to set order number.

I just want to know is this at all possible or am i trying the impossible?

The most readable way using concatenation.

$pdf->Image('./upload_images/' . $pro_forma_number . '.jpg',50,50,10,);

Or simply switch to double quotes:

$pdf->Image("./upload_images/$pro_forma_number.jpg",50,50,10,);

See also: http://php.net/manual/en/language.types.string.php