limessl Posted January 9, 2010 Share Posted January 9, 2010 I have a variable that is returned as text, but for the API that I'm integrating it requires the text to be sent back inside quotation marks. So at the moment the code says $valid = "text string" $req['Request']['OrderRequestParameter']['ValidityPeriod']['Months'] = $valid; so the value being transmitted to the API is text string rather than "text string" note that $valid is actually being created from another variable, so it's not as easy as saying $valid = "/"text string/"" Link to comment https://forums.phpfreaks.com/topic/187818-creating-a-string-which-includes-quotation-marks/ Share on other sites More sharing options...
cags Posted January 9, 2010 Share Posted January 9, 2010 Actually you got the escape slashes the wrong way round they should be backslashes not forward slashes. Why not just use something like... $valid = '"'.$valid.'"'; // or $valid = "\"{$valid}\""; Link to comment https://forums.phpfreaks.com/topic/187818-creating-a-string-which-includes-quotation-marks/#findComment-991653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.