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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:21:41+00:00 2026-05-14T00:21:41+00:00

i have a task – i must grab some data from the URL. the

  • 0

i have a task – i must grab some data from the URL. the link is http://cba.am.
the data, i want to take, are in the some table, and i have the only one identifier, to reach my wanted data, it’s the word “usd”, which writes in that table(html)!
i’ve written the following script, and it works! but i never heard how more experienced programers do such things, so i want to hear your comments.


here is script

<?php
    $str = file_get_contents("http://cba.am/");
    $key_usd = "USD";
    $sourse_usd_1 = explode($key_usd,$str);
    $usd1 = $sourse_usd_1[2];
    $sourse_usd_2=explode(">",$usd1);
    $usd2 = $sourse_usd_2[4];
    $sourse_usd_3=explode("<",$usd2);
    $usd = $sourse_usd_3[0];
?>

sorry for poor english:)

  • 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-14T00:21:41+00:00Added an answer on May 14, 2026 at 12:21 am

    Well, as long as the approach works for you (and they don’t give you trouble for using it), it is fine. This technique is called “scraping”. However, if they decide to change their site’s structure, for example change the HTML tags or their position, your script will break, and you will have to update it. (You better have a mechanism in place to detect if the numbers don’t make sense, so you can be warned.)

    The much better and cleaner way would be to have them (the central bank, in that case) publish the data in a defined form, e.g. as a Web service, RSS feed or XML output that you can access.

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

Sidebar

Related Questions

I have a task to do, I need to take data that has been
I have one task that is checking a url speed, but i want that
I have a task of copying the data from one database to another.I don't
I have the task to program one module to store some data and another
I have some task regarding do operations on database using ADODB in Vb.NET. Can
I have the task to integrate some commercial sharing stuff into a website. The
I have a task that runs periodically 10 second. I do some picturebox refreshing
I have the task of creating implementations for a large number of metric data
I am from DW/BI background using SAS for many years now I have task
I would like to run a background task on some interval from a web

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.