Mixed HTML and PHP in Echo

I'm personally not a fan of shortcodes. I've got to maintain a lot of legacy PHP code and the shortcodes become hard to read in larger files.

Then again I've been doing PHP for over 10 years.

That's my feeling as well, I'm glad I'm not the only one since kabel made it feel like I am.
 
To be clear I NEVER advocated for the use of short open tags, only short echo tags.

If you find your html littered with php tags, or your php littered with HTML strings, you are doing something wrong anyway. Obviously legacy code exists that is like this, but I see no point in doing this in any new code.
 
To be clear I NEVER advocated for the use of short open tags, only short echo tags.

If you find your html littered with php tags, or your php littered with HTML strings, you are doing something wrong anyway. Obviously legacy code exists that is like this, but I see no point in doing this in any new code.

We will have to agree to disagree.
 
What did I say that you disagree with and why?

I think you have a bad case of the Dunning-Krugers
 
Last edited:
If you're looking for performance, why aren't you doing this client side?

Read the whole thread. Not looking for performance I merely asked kabel if there is a performance upside when using the short code version of echo as he suggested is the correct way instead compared to writing it out like I did.
 
Last edited:
Read the whole thread. Not looking for performance I merely asked kabel if there is a performance upside when using the short code version of echo compared to writing it out like I did.
Shorter code is easier to read. I doubt there's a performance increase.

Anyway this should be done client side.
 
What did I say that you disagree with and why?

I think you have a bad case of the Dunning-Krugers

Echo the shortcode version compared to the normal way.

And the part where you said if you have php in you html your doing it wrong.

By all means go to my thread file get contents and rewrite it "correctly" if it is wrong.

But I doubt it you come across as someone who want to force devs into doing things a certain way not because it's the best practice or ideal way but simply because it's the way YOU do it.

Maybe I'm wrong, maybe I'm miss labeling you, I don't know.
 
Last edited:
Shorter code is easier to read. I doubt there's a performance increase.

Anyway this should be done client side.

You want me to put that in Javascript?

I highly doubt that's the way to go,

#1 Javascript is a luxury so won't work if the client doesn't allow it secondly how is Javascript suppose to read and write to the dB?
 
You want me to put that in Javascript?

I highly doubt that's the way to go,

#1 Javascript is a luxury so won't work if the client doesn't allow it secondly how is Javascript suppose to read and write to the dB?
What are you writing to the db?
 
You want me to put that in Javascript?

I highly doubt that's the way to go,

#1 Javascript is a luxury so won't work if the client doesn't allow it secondly how is Javascript suppose to read and write to the dB?

1.3% of browsers on the web don't use JavaScript or have it disabled...

It's no longer a 'luxury'
 
1.3% of browsers on the web don't use JavaScript or have it disabled...

It's no longer a 'luxury'

This is a php thing I can't do this in javascript and would prefer not to have it in JS either.

Like I said this is OT my OP has been answered perfectly.
 
This is a php thing I can't do this in javascript and would prefer not to have it in JS either.

Like I said this is OT my OP has been answered perfectly.

Well technically you can do it in javascript. Server side.
 
Top
Sign up to the MyBroadband newsletter
X