I have an HTML page that I generate from the data contained in a database. The database sometimes contains long strings that the browser can\'t break because the strings don\'t
The issue with using
and the solutions above is that an extra character is still there, and with a copy/paste action (even in plain text) it comes out.
I would use instead the tag
that is not visible and is not considered when copying.
For example, to have email addresses break in two lines (only when there is not enough space) I use this:
echo str_replace( "@","@", $email );
That results in something like this:
name.surname
@website.com