Ran into a small PHP string problem which I was unable to find a solution to. I am trying to insert a variable value into the following string format, but it just inserts the variable, not the value of the varaible. Most likely a real easy fix, but I can't seem to figure it out.
$name ="michael";
$datastring = '{
"order": {
"items": [
{
"reference": "webshop",
"name": $name,
"quantity": 1,
}
]
}
}
How do I get it to replace $name with michael in this example here?