By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,491 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,491 IT Pros & Developers. It's quick & easy.

Displaying Dollar Sign in WAP, served with PHP

P: 3
Im wanting to display a dollar sign on my wap application, which requires that the cell phone is served with [HTML]$$[/HTML] to display [HTML]$[/HTML].

Therefor I'm trying to find an easy way, in my php code, that will always add a dollar sign next to any existing dollar sign. so that dollar signs are always served in pairs

The content is residing in a MySQL database.

Thanks for any help that can be offered.
Apr 19 '07 #1
Share this Question
Share on Google+
2 Replies


tolkienarda
100+
P: 316
Im wanting to display a dollar sign on my wap application, which requires that the cell phone is served with [HTML]$$[/HTML] to display [HTML]$[/HTML].

Therefor I'm trying to find an easy way, in my php code, that will always add a dollar sign next to any existing dollar sign. so that dollar signs are always served in pairs

The content is residing in a MySQL database.

Thanks for any help that can be offered.

use the str_replace function
somthing like

[PHP]
$string = 'asdf%asdf%asdf';
$find = '%';
$replace = '%%';
$newstring = str_replace($find, $replace, $string);
//$newstring should be asdf%%asdf%%asdf
[/PHP]
you will probably need to slash out some of the special characters with a '\'.

if i misunderstood your question please repost and clarify or if my answer was unclear then repost and i will clarify

eric
Apr 20 '07 #2

P: 3
This is exactly what I was looking for, Thanks for your reply
May 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.