Jump to content

Creating a Custom echo() function?


random1

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/171910-creating-a-custom-echo-function/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.