3v4l.org

run code in 200+ PHP versions simultaneously
<?php $data = "\"Got'ta apostrophe you can spare?\", \"Got\\'ta apostrophe you can spare?\""; //$data = str_replace("'","\\'",$data); $data = str_getcsv($data, ",",'"'); var_dump($data);
based on BgVWA
Output for 7.1.0 - 7.4.0
array(2) { [0]=> string(32) "Got'ta apostrophe you can spare?" [1]=> string(33) "Got\'ta apostrophe you can spare?" }