Jump to content

Search the Community

Showing results for tags 'dollar sign'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. I've been working on my own templating feature in which a page of static html is replaced by php variables when they exist. When $ (dollar sign) exists on the static page before the templating magic it is getting omitted when i replace things using preg_replace() for the output. This simple example illustrates this: $price = '$10.99'; $template = 'Your cost: $price'; $output = preg_replace('/\$price/', $price, $template); echo $output; //Your cost: .99 notice the "$" is now missing from output. Anyone know how to solve this problem and preserve dollar signs in an elegant way. I know I can do something like $price = str_replace('$', '\$', $price); but that seems ugly and simply another string function that isn't necessary. (I'm already using a lot of resources to make the templating feature work) Note: I'm using php ver. 5.2 I thought maybe preg_replace_callback() might work but it doesn't seem to be supported
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.