Forum Moderators: coopster

Message Too Old, No Replies

getting rid of whitespace

         

mincklerstraat

6:41 pm on Mar 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<edit: solved>
I'm trying to get rid of whitespace in a document for feeding a string into imagettftext - there seems to be some kind of tab-like character that screws it up when it's part of the string given to imagettftext.
One example of this bit of whitespace is in the downloadable multi-html page php manual, on the page for array_walk, in the text 'array_walk -- Apply a user function' - the nasty bit of whitespace I'm having problems is between the -- and the big A in Apply.
I've tried removing "\r", "\n", "\t" (and even "\f" using str_replace and a replace array, but to no avail. I've tried zapping it with \S using a regular expression but it remains. Someone please help me remove this formidable whitespace.
<edit>sorry people, just one of the usual suspects, "\t" I think - was kicking myself in the head for hours without noticing that I didn't define my search haystack array until *after* I called the function that does the str_replace, and some other variable with the same name must be floating around since this didn't trigger a notice.</edit>

coopster

9:23 pm on Mar 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



glad we could help, minck ;)

hehe, I banged my head for a couple of hours today trying to figure out why a return from a external (included) function was causing my switch statement to break all the way out of the switch and kill my while loop as well. Turns out I was closing the stinking database connection in the function call. Of course, the while loop won't throw any errors since it was indeed FALSE when trying to fetch data!

The funny part is I was convinced I had a bug on my hands and almost submitted a report. Wouldn't that have been nice! Oh well, all over now, and I even saved myself the embarrassment of submitting a BOGUS PHP bug report.