RE: [PHP] Problem with the double quotes
On Tue, 14 May 2002, Manisha wrote: The file is HTML file. Actually I am sending email with message as this HTML file's content. I changed the header of email to accommodate HTML. Reading the file in array and putting array values as a message - whether still double quotes will not give problem ? It is no problem to have double quotes in a string. The only problem is getting the double quotes in there. If they come from a string literal - that is, a string that you have typed into your PHP code - then you may have to escape them. If the quotes come from a file or from a database or from user input or whatever, then you don't have to do anything; they appear in the string like any other character. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with the double quotes
Thanks to all who gave me reply. manisha At 02:40 AM 5/14/02 -0500, Miguel Cruz wrote: On Tue, 14 May 2002, Manisha wrote: The file is HTML file. Actually I am sending email with message as this HTML file's content. I changed the header of email to accommodate HTML. Reading the file in array and putting array values as a message - whether still double quotes will not give problem ? It is no problem to have double quotes in a string. The only problem is getting the double quotes in there. If they come from a string literal - that is, a string that you have typed into your PHP code - then you may have to escape them. If the quotes come from a file or from a database or from user input or whatever, then you don't have to do anything; they appear in the string like any other character. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with the double quotes
You shouldn't need to addslashes() if you read from a file, only for string literals, like in your test. Are the file(s) you're reading in, just text files? If so, try doing your code with the file read commands and you should see you don't need to addslashes() -Original Message- From: Manisha [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 11:47 AM To: php-general Subject: [PHP] Problem with the double quotes I want to display the content of a file containing double quotes. It is giving me error. I experimented with one small string variable. If I add 'Slash' manually, then it is ok. But addslashes function is not working $str1 = addslashes(this is the msg ); This gives me error. But $str1 = addslashes(this is the \ \ msg ); This is ok. Manually adding slah to big file quiet impossible. Is there any good solution for this ? How to convert double quotes of file into \ ? Thanks in advance Manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the double quotes
Please read the following: Using Strings in PHP http://www.zend.com/zend/tut/using-strings.php Strings http://www.php.net/manual/en/language.types.string.php Notice stripslashes(), addslashes(), the PHP directive magic_quotes_gpc and the use of ' vs . Regards, Philip Olson On Tue, 14 May 2002, Manisha wrote: I want to display the content of a file containing double quotes. It is giving me error. I experimented with one small string variable. If I add 'Slash' manually, then it is ok. But addslashes function is not working $str1 = addslashes(this is the msg ); This gives me error. But $str1 = addslashes(this is the \ \ msg ); This is ok. Manually adding slah to big file quiet impossible. Is there any good solution for this ? How to convert double quotes of file into \ ? Thanks in advance Manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with the double quotes
The file is HTML file. Actually I am sending email with message as this HTML file's content. I changed the header of email to accommodate HTML. Reading the file in array and putting array values as a message - whether still double quotes will not give problem ? manisha At 11:51 AM 5/14/02 +1000, Martin Towell wrote: You shouldn't need to addslashes() if you read from a file, only for string literals, like in your test. Are the file(s) you're reading in, just text files? If so, try doing your code with the file read commands and you should see you don't need to addslashes() -Original Message- From: Manisha [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 11:47 AM To: php-general Subject: [PHP] Problem with the double quotes I want to display the content of a file containing double quotes. It is giving me error. I experimented with one small string variable. If I add 'Slash' manually, then it is ok. But addslashes function is not working $str1 = addslashes(this is the msg ); This gives me error. But $str1 = addslashes(this is the \ \ msg ); This is ok. Manually adding slah to big file quiet impossible. Is there any good solution for this ? How to convert double quotes of file into \ ? Thanks in advance Manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php