PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am trying to build a larger function but find I am failing miserably at the basics of creating a simple one.
The core function is used to replace some text in a string. Although the replace function inside checks out when used independently, the created function simply returns nothing.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Saved as testscrubber2.php on local MAMP server.
Throws the following error...
Parse error: syntax error, unexpected T_STRING in /Applications/MAMP/htdocs/testscrubber2.php on line 5
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Well, yes and no, Jcart. I copied straight from the post into BBedit saved and it threw the error. But then I used the "convert to ascii" and "zap gremlins" functions and apparently there were gremlins that were invisible and now the code runs great. Whatever was fooling the parser was invisible for sure.