Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 609305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:33:08+00:00 2026-05-13T17:33:08+00:00

I have a text editor on my web page, on that text editor i

  • 0

I have a text editor on my web page, on that text editor i put image and than i use that image in different parts of my website, but in different places the image size differs.

The image in database is stored this way: <div><img width="210" height="150" alt="" src="/portali/userfiles/image/Kategorite/Teknologji/-1.jpg" /></div>

Now in one part of my web site i want to use this same image with different size and for this reason i need some php script to grab only the path of the image, in this sample (/portali/userfiles/image/Kategorite/Teknologji/-1.jpg).

Can some body write here some basic script to do this having in mind that the whole html code of the image is in an single variable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:33:08+00:00Added an answer on May 13, 2026 at 5:33 pm
    $html = '<?xml version="1.0" encoding="UTF-8"?>'.$yourHTMLFromDb;
    $elements = new SimpleXmlElement($html);
    $url = $elements->img->attributes()->src;
    

    Now im sure i wont be the first to say it but… “Youre doing it wrong”. You should only be storing the path to the image in the database (and maybe some other attribnutes) not an html snippet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want arich text editor for embedding in webpage but it should have tools
I have built a rich Text Editor for Flex 4 using the instruction in
My boss has asked for a page that will not change to have two
I have just coded the below regular expression. I have a mini rich text
As part of a job I'm doing on a web site I have to
I am a LAMP developer but am also advanced in CSS/HTML. The problem is
I know drupal, and wordpress, but i am more please with hand coding site
Whats the best way to make the following HTML text block a hardcoded string
After so many years using ASP.Net, I’m still trying to figure out how to
I'm new to ASP .Net MVC 2. My site displays a form with 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.