ivoilic Posted February 27, 2012 Share Posted February 27, 2012 So I wanted to use a \ in order to stop PHP from registering my quotes. For some reason it does not seem to work. I am running PHP version 5.3.8. What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/ Share on other sites More sharing options...
AyKay47 Posted February 27, 2012 Share Posted February 27, 2012 Is magic_quotes_gpc enabled? Can you give us some code to work with. Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321557 Share on other sites More sharing options...
ivoilic Posted February 27, 2012 Author Share Posted February 27, 2012 <?php imagettfbbox(30, 0, $italic, $desc); imagettftext($image, 30, 0, 70, 700, $fontcolor, $italic, stripslashes(\"$desc\")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321574 Share on other sites More sharing options...
blacknight Posted February 27, 2012 Share Posted February 27, 2012 stripslashes(\"$desc\") why do you have " here anyway you dont need them.... Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321579 Share on other sites More sharing options...
ManiacDan Posted February 27, 2012 Share Posted February 27, 2012 You don't need quotes around this variable at all. Escaped quotes are only supposed to be used inside of other quotes. They are necessary here: $string = "Dan says \"escaping your quotes is only necessary inside of strings\" because that's the kind of thing he says."; Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321668 Share on other sites More sharing options...
ivoilic Posted February 27, 2012 Author Share Posted February 27, 2012 I figured it out! I need a second pair of quotes outside of the first set. Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321799 Share on other sites More sharing options...
ManiacDan Posted February 27, 2012 Share Posted February 27, 2012 Please read the responses, the experts here are worth a lot of money, you're getting thousands of dollars worth of professional help for free. You don't need quotes around this variable at all.I told you that you don't need quotes at all, and you added MORE quotes. Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321804 Share on other sites More sharing options...
AyKay47 Posted February 27, 2012 Share Posted February 27, 2012 I figured it out! I need a second pair of quotes outside of the first set. ManiacDan has a good point. If you are not going to take the time to read and understand the responses, why bother posting at all? I have no idea why you feel the need to add slashes to that bit of code, but they are not needed at all, as ManiacDan has already pointed out. Rather frustrating. Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1321821 Share on other sites More sharing options...
ivoilic Posted March 1, 2012 Author Share Posted March 1, 2012 Please allow me to explain: My goal was to have quotes automatically added around text entered by the user. I didn't realize that for the slashes to work I needed a second set of quotes. I apologize for wasting the time of anyone here. I will be more clear next time. Quote Link to comment https://forums.phpfreaks.com/topic/257845-does-not-work/#findComment-1322567 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.