Hello
i'm working on forum, and the topics content sometimes got images thats bigger then forum warper

i need to reduce them by PHP
lets say that the content is $row;

please help .

Recommended Answers

All 5 Replies

You can set max image sizes in css, for example:

#forum_wrapper img {
  max-width: 400px;
}

yea i that about that, but there is not way by PHP ?
i just wanna learn more if i can :)

Well, if the images are hosted on your own server, you can of course make them smaller in PHP, is that what you mean? Otherwise, there's not much you can do "in PHP".

i that that i can get all images by preg_match of (img_src)
and then get the src off evry image and use imagegetsize,
but never mind, i'm using the max-width by CSS
thanks .

Mark this as 'Solve' if your problem solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.