random1 Posted August 26, 2009 Share Posted August 26, 2009 Hey All, I'd like to override or create a custom echo() function. In PHP: echo 'this', 'is', 'a', 'test'; is valid but echo('this', 'is', 'a', 'test'); is not valid. My aim is to allow the code: echo('connected ', 'string ', 'for ', 'live site.'); and ouput: connected string for live site. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/171910-creating-a-custom-echo-function/ Share on other sites More sharing options...
oni-kun Posted August 26, 2009 Share Posted August 26, 2009 It's not valid because you're using commas within parentheses '()'. It'd take a lot of wasted time to write a custom 'echo', as echo is a language construct, not a function. You must use periods to concatinate in brackets. echo('this'. 'is'. 'a'. 'test'); If you're wanting to echo something delimited by commas, then replace them accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/171910-creating-a-custom-echo-function/#findComment-906481 Share on other sites More sharing options...
ignace Posted August 26, 2009 Share Posted August 26, 2009 Download the PHP source code from http://us2.php.net/downloads.php Learn how to hack the PHP core http://us2.php.net/manual/en/internals2.php and write your own echo (language construct) Quote Link to comment https://forums.phpfreaks.com/topic/171910-creating-a-custom-echo-function/#findComment-906494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.