Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: str_replace lowercase problem
05-20-2011, 02:24 PM #1
- Join Date
- Mar 2011
- Thanked 0 Times in 0 Posts
str_replace lowercase problem
I have a problem with str_replace function. I am replacing some chars and spaces so that I can use them i.e. as id of div.
For some reason one time it outputs like " alfaromeo" and the other time like it should be "AlfaRomeo" - any ideas ?
05-20-2011, 02:33 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Not with what you have posted here it doesn't. The code you have has an additional space preceding the string which doesn't exist, and str_replace will not cause a replacement of case. Combined with the additional set of <? and ?> tags (you should avoid using short_tags btw), tells me there is code between the first two variables you've declared and the foreach which is affecting the $marki result.
I'm betting that JS code won't work properly either. The use of the double quotes within the double quotes indicates to HTML that you have completed an attribute, so those should be changed to escaped single quotes.
Users who have thanked Fou-Lu for this post: