When I save a youtube embed iframe into my database it adds a bunch of slashes when i recall it. Like so below.
<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/ycHXRWRKrdA?rel=0\" frameborder=\"0\" allowfullscreen></iframe>
its is being stored in a longtext type. what would remove the slashes when I recall it from the database or prevent slashes being stored in the first place
Don't save the HTML like that - just save the youtube unique ID and then spit out the HTML and plug in the ID from the database.
PHP Regex to get youtube video ID?
if you use PHP, you can use stripslashes().
Alternatively you can base64 encode / decode the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With