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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:16:52+00:00 2026-05-27T07:16:52+00:00

Slowly, but surely, I’m assembling a website for personal usage where I search for

  • 0

Slowly, but surely, I’m assembling a website for personal usage where I search for the name of a movie and it returns me the metacritic rating of it. Here’s what I got so far:

$web = file_get_contents("http://www.metacritic.com/movie/the-lion-king"); 

preg_match(
    '/<span class="score_value" property="v:average">(.*?)<\/span>/s',
    $web,
    $match
 );

foreach ($match as $score) {
    $sc = $score;
    echo $sc;
}

Result:

8383

Where it should return only 83 and not 8383.

I pointed the way to where the metacritic rating is located because I need to grab that information. I’m not sure whether or not it’s correct? May be some very crude work, I don’t understand preg_match very well, the documentation online did not help a bit.

Can someone please help me?

  • 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-27T07:16:52+00:00Added an answer on May 27, 2026 at 7:16 am

    You should only echo out $score[1] because that is where your first captured parenthesized subpattern will go.

    Read documentation for preg_match

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

Sidebar

Related Questions

I'm slowly but surely putting together my first rails app (first web-app of any
I run a site that is slowly but surely draining all of the available
new guy here and I'm slowly getting the hang of python, but I have
I have been learning (slowly but surely) how to do deal with sqlite databases
Slowly but surely I think I'm going mad. After getting the solution to my
I'm a Flash developer but have been slowly moving to developing my applications in
I'm slowly learning the ins and outs of LINQtoSQL, but this is confusing me.
My macro updates a large spreadsheet with numbers, but it runs very slowly as
I have a large list of instructions that I need executed sequentially but slowly.
I am slowly porting over an app from MySQL to use Linq2Sql - but

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.