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 7650409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:14:44+00:00 2026-05-31T11:14:44+00:00

I am trying to create a feature on my website where users can upload

  • 0

I am trying to create a feature on my website where users can upload links, like Digg. I have code that grabs the HTML source code from the URL that a user uploads to my website, and stores it in a .txt file. Then I want to grab the contents in the tag

<meta name="content" description="GRAB THIS"> 

assuming this tag exists. Sometimes it works, but other times it doesn’t work, even though the source code for that particular webpage contains the necessary meta tag exactly as I have specified in my code. I’ve noticed that it seems to not work correctly if the “GRAB THIS” content contain html entities (&, etc.). Please let me know if you have any ideas on how to get this to work. Here is my code:

$html_data = file_get_contents( $path_to_txt_file_that_contains_html );
preg_match( '#<meta name="description" content="(.+?)">#si', $html_data, $tor;
$tor = str_replace ( '<meta name="description" content="' , "", $tor[0] );
$tor = str_replace ( '">', "", $tor );

Sometimes $tor still contains

<meta name="description" content="CONTENT"

but without the closing >, so my code breaks once I put this in a mySQl database. Any ideas on what I’m doing wrong? Thanks ahead of time for any help!

  • 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-31T11:14:45+00:00Added an answer on May 31, 2026 at 11:14 am

    It’s actually extremely simple.

    PHP offers it’s own built in solution: http://php.net/manual/en/function.get-meta-tags.php

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

Sidebar

Related Questions

I'm trying to create a feature that both creates a list template and an
Im trying to create a simple image resize feature, can you tell me where
I am trying to create dynamic predicate so that it can be used against
I`m trying to create the following feature: You register and receive an email like
I'm trying to create a feature that's similar to what Google News does -
I'm trying to create a WP7 application that will upload an image to my
I'm trying to create a script that will move a feature branch to an
I'm trying to create a feature for the Script Encoder that I'm creating that
I'm trying to create a feature similar to that of Geogebra 's toolbar: it
I'm trying to create a simple message feature for my website but I couldn't

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.