Because you must replace it after $total and $buffer are defined, not
before.

This works :
  <?php
    
    $total  = 'foo';
    $buffer = 'blah blah %99 blah blah';

    $buffer = str_replace('%99', $total, $buffer);

    print $buffer;
    
  ?>
   
This does not work :
  <?php
   
    $buffer = str_replace('%99', $total, $buffer);
    
    $total  = 'foo';
    $buffer = 'blah blah %99 blah blah';
    

    print $buffer;

  ?>

Regards,

Philip Olson  
http://www.cornado.com/

On Wed, 31 Jan 2001, Augusto Cesar Castoldi wrote:

> In the begin of my site, I have the following code:
> <?
> $buffer = str_replace("%99", $total, $buffer);
> ?>
> 
> And somewhere on <html> tag I write %99.
> 
> I pretend to replace the %99 with $total. Why it doesn't work? When I
> publish my site appears the %99 on screen, and not the $total.
> 
> thanks,
> 
> Augusto Cesar Castoldi
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to