Php Cant insert Json data with apostrophe to database

I have some json data that i am retrieving from an external url. I am storing the data but It seems that the values that have an apostrophe "Tes't2" is being skipped over. I have seen people say to quote escape this, but i am not sure how to do this. I'm a noobie. Thanks!