How do use '  ' within this code?

lawrence_dev
lawrence_dev used Ask the Experts™
on
I am getting an error on this line.  How do I fix?  I have tried several variations.

$db2     = "productf_' . $supplier['db'] . '";

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
Commented:
try:

$db2     = 'productf_' . $supplier['db'] ;

Open in new window

Author

Commented:
Thanks!!
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You can also do this
$db2 = "productf_{$supplier['db']}";

Open in new window


EDIT
Your question is confusing - you have mixed " and '
It looks like your opening question is asking to produce this output

productf_'somevalue'

I am guessing this is not the case
Most Valuable Expert 2011
Top Expert 2016

Commented:
For anyone coming to this question in the future, E-E has an article explaining how PHP handles quotes and apostrophes.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial