S
S
sixt42021-06-18 18:56:51
MySQL
sixt4, 2021-06-18 18:56:51

How to remove spaces in links in mysql database?

Hi all.
Actually the question is in the title.
I noticed on the site that many pictures are not loaded, since there is a space in their link in an arbitrary place.
How can I remove spaces in links?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2021-06-18
@Don_Andreas

And through what are they loaded or where are they displayed? In fact, the link is just a string in the database. process it by replacing empty characters in the string (str_replace(' ','', $str);). Either before uploading to the database, or before issuing it to the face (but the second option is better not needed, performance in theory will someday leave the chat).
In general, you need to go one step back and look for where there is a gap in an arbitrary place. Is the name of the image generated when uploading to the site? When sending a picture to the server, do the processing of the name and replace all Cyrillic characters with lat. and spaces to underscore "_".
PS: I also thought so ... but is this really a gap? can't it be that it was originally a line break or something else? But in any case, I would dig towards the loading point, and not the issuance of a picture, 99%, that the whole bacchanalia comes from there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question