RE: [PHP] text with $

2005-05-09 Thread Mikey
> > I have a text variable that contains "$" symbols, that when 
> I pass it 
> > out PHP thinks that the "$" mean that a variable name comes 
> right after.
> >
> To include the string symbol in a variable, use the single quotes.
> 
> $myvar='this is $$$ test';

Or, if you still want to use interpolation, use the backslash to escape the
$:

$str = "\$foo = $bar";

HTH,

Mikey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread Brent Baisley
Do you mean you named a variable like $varia$le? I wouldn't do that.
If you mean you have something like:
"A text $tring with $ome dollar$"
Just put it in single quotes instead of double quotes. PHP doesn't 
evaluate what's inside single quotes.
'A text $tring with '.$variable.'  dollar'

On May 9, 2005, at 8:23 AM, Martín Marqués wrote:
I have a text variable that contains "$" symbols, that when I pass it 
out PHP
thinks that the "$" mean that a variable name comes right after.

I tried escaping the "$" put with no luck.
Is there something I can do?
--
 09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] text with $

2005-05-09 Thread =?iso-8859-1?q?Mart=EDn_Marqu=E9s?=
El Lun 09 May 2005 11:44, Marek Kilimajer escribió:
> Martín Marqués wrote:
> > I have a text variable that contains "$" symbols, that when I pass it out 
PHP 
> > thinks that the "$" mean that a variable name comes right after.
> > 
> > I tried escaping the "$" put with no luck. 
> > 
> > Is there something I can do?
> > 
> 
> How did you escape the symbol? You should use backslash: \

Sorry, my misstake. :-(

I was doing: 

srt_replace("$","\$",$string);

instead of: 

srt_replace("$","\\$",$string);

Forgot to escape the escape caracter! :-D

-- 
 11:45:49 up 37 days, 20:09,  2 users,  load average: 1.37, 1.07, 1.06
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread bala chandar
hi 

On 5/9/05, Martín Marqués  wrote:
> I have a text variable that contains "$" symbols, that when I pass it out PHP
> thinks that the "$" mean that a variable name comes right after.

use this

$$text = "$text";


> 
> I tried escaping the "$" put with no luck.
> 
> Is there something I can do?
> 
> --
>  09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
> -
> Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
> Centro de Telematica  |  DBA, Programador, Administrador
>  Universidad Nacional
>   del Litoral
> -
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
bala> balachandar muruganantham
blog> lynx http://chandar.blogspot.com
web> http://www.chennaishopping.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread Marek Kilimajer
Martín Marqués wrote:
I have a text variable that contains "$" symbols, that when I pass it out PHP 
thinks that the "$" mean that a variable name comes right after.

I tried escaping the "$" put with no luck. 

Is there something I can do?
How did you escape the symbol? You should use backslash: \
Or use single quotes.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] text with $

2005-05-09 Thread disguised.jedi
On 5/9/05, Martín Marqués  wrote:
> I have a text variable that contains "$" symbols, that when I pass it out PHP
> thinks that the "$" mean that a variable name comes right after.
/*
This is standard behavior, as far as I know.  Are you using an IDE, or
just a standard text editor?  Many IDEs will notify you of this, or
just escape it automatically.
*/ 
> I tried escaping the "$" put with no luck.
/*
Escaping didn't work?  That's strange.  Could you post the code?  This
would help, as I think you might not be escaping it correctly.  See
below...
*/ 
> Is there something I can do?
/*
'Single Quotes?'  Be sure that when you escape it you are using \, not
/!  Again, try posting code.  You're always more likely to get
responses if you post the code, and/or any error messages you get.
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread Petar Nedyalkov
On Monday 09 May 2005 15:23, Martín Marqués wrote:
> I have a text variable that contains "$" symbols, that when I pass it out
> PHP thinks that the "$" mean that a variable name comes right after.
>
> I tried escaping the "$" put with no luck.

Use single quote.

>
> Is there something I can do?
>
> --
>  09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
> -
> Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
> Centro de Telematica  |  DBA, Programador, Administrador
>  Universidad Nacional
>   del Litoral
> -

-- 

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436


pgpjAfU9TNVpW.pgp
Description: PGP signature


Re: [PHP] text with $

2005-05-09 Thread =?ISO-8859-1?Q?Victor_Salda=F1a_D=2E?=
On 5/9/05, Martín Marqués  wrote:
> I have a text variable that contains "$" symbols, that when I pass it out PHP
> thinks that the "$" mean that a variable name comes right after.
> 
> I tried escaping the "$" put with no luck.
> 
> Is there something I can do?

$var = 'hi $there';

-- 
Victor Saldaña D.
User #330054 counter.li.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread Andy Pieters
On Monday 09 May 2005 14:23, Martín Marqués wrote:
> I have a text variable that contains "$" symbols, that when I pass it out
> PHP thinks that the "$" mean that a variable name comes right after.
>
To include the string symbol in a variable, use the single quotes.

$myvar='this is $$$ test';

Andy
-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C$(+++) UL>$ P-(+)>++
L+++>$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>$@ h++(*) r-->++ y--()>
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread Richard Davey
Hello Martín,

Monday, May 9, 2005, 1:23:45 PM, you wrote:

MM> I have a text variable that contains "$" symbols, that when I pass it out 
PHP
MM> thinks that the "$" mean that a variable name comes right after.

MM> I tried escaping the "$" put with no luck. 

$string = "hello\$world";

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php