0

Hello people.. I have written a code that replaces IMG tags in a text with the HTML <img tag.. However, I faced a problem; Big images spoiled the layout of the page being viewed.
Is there anyway to limit the size of the image only when it's more than 300 wide and 400 high??
This is my code:

$Txt = $_POST['Text'];
$arrA = array('[img]','[/img]');
$arrB = array('<img src="','">');
$Txt = stri_replace($arrA,$arrB,$Txt);
echo $Txt;

So I want to set the size limits as: 300,400.

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Pro2000
1

This issue has to do with CSS; you can add the following to the style of the image:

max-width:????; /* You can also use percentage in the value*/

This property works on CSS2.
Hope it helps.

Edited by Pro2000: n/a

Votes + Comments
Thanks for your effort
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.