crownedlake
crownedlake

Reputation: 43

addslashes() function in PHP is not able to replace all ' in my string

I am trying to use txt file hosted at http://terriblytinytales.com/test.txt in php. I am saving all individual words in a database using mysql. I am using addslashes() function like this

$txtFile = addslashes(file_get_contents('http://terriblytinytales.com/test.txt'));

But after successfully saving in the database, the ' in the string I got by file_get_contents('http://terriblytinytales.com/test.txt') is not replacecd.

only the first ' in we're is replaced and others are same. Please help

Upvotes: 1

Views: 35

Answers (0)

Related Questions