I'm trying to convert textarea text into a string I can put into the postcodes.io checker API
Example of textarea:
TW7 8PX
TW14 8NU
W3 7JW
This then needs to convert to:
"TW7 8PX", "TW14 8NU", "W3 7JW"
Currently I am using a manual string:
$query = '"TW7 8PX", "TW14 8NU", "W3 7JW"';
$postcode = new Postcode();
$lookup = $postcode->bulkLookup(array($query));
I imagine it's achievable with preg_replace but I can't seem to find the combination I need.