woocha Posted December 17, 2007 Share Posted December 17, 2007 Hey Guys... I have a quick question and I am hoping you can help... I am pulling data from a Mysql DB and the code looks like this: $file1 = $r['item_numb']; this works just fine but I need to concat and extension to $r['item_numb']; so that if $r['item_numb']; equates to 210210, I need $file1 toe be 210210.txt This way I can take a piece of information from a db and turn it into a file name. Thank you Quote Link to comment Share on other sites More sharing options...
craygo Posted December 17, 2007 Share Posted December 17, 2007 <?php $file1 = $r['item_numb']; if($file1 == "210210"){ $file1 .= '.txt'; } echo $file1; ?> Ray Quote Link to comment Share on other sites More sharing options...
woocha Posted December 17, 2007 Author Share Posted December 17, 2007 That worked brilliantly, Thanks Ray Quote Link to comment Share on other sites More sharing options...
craygo Posted December 17, 2007 Share Posted December 17, 2007 NP Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.