With the very good to the community, I have the following doubt, I am working in php and mysql. I need to change a part of a
<img src="http://localhost/upload/foto.jpg" width="259" height="194" />
I want to remove the width and height of the img, because that will be handled from the css code, so that it is responsive and fits freely on the page. As when a new article is created, sometimes there are several images within the same article $_POST['article'] , I tried to do it with explode but it doesn't work, and I would like to do the same with the
if you could help me i would appreciate it
<form method="POST">
<textarea name="articulo"></textarea>
</form>
therefore everything written to the textarea will be under tinymce.
<?php
$articulo=$_POST['articulo'];
//reemplazo algunos caracteres
$articulo=str_replace('<img src="../..', '<img src="http://localhost/", $articulo);
example: the $article would come with the following ->
<p>este es un articulo para mostrar <img src="localhost/upload/foto.jpg" width="259" height="194" /></p>
here I need to do the elimination of the witdh and height that comes in the label
If you want it, it is just to remove the width and the height when you try this:
I mean, your code would look like this:
HTML
You should address the image from where it is stored, not from the localhost url, change src to:
Do not forget that you must add the tag to responsively apply the attributes that you will apply to the image, in this case your css.
Lastly, in your css code, if you want the image to take 100% of the device's screen, you must assign the corresponding property:
CSS
}