I have an old windows 95 program that exports data without account numbers, seasonal accounts, and if accounts contains a sub account.
I am, however, able to print customer information and notes that has the above information to a pdf file and copy that text to notepad; which I would like to extract the data.
The order the data: 1) page headers (I do not need this data.)
Company Name
Customer Information and Notes
Computed Monday, August 10 2015 Page 1
2) standard titles and 3) the data after titles:
Ser Name: Block, Sunny Route: 1
Address: 3354 ASPEN RD. Frequency: Monthly
Address: ST PETE, GA 33333 Week/Day: First Monday
City State Zip: data Sched Time (HH:MM): 10:00A
Ser Phone: 555-1212 Service: BASIC SERVICE
Bill to: BLOCK,SUNNY Rate ($): 24.00
Company Name
Customer Information and Notes
Computed Monday, August 10 2015 Page 2
Address: 1123 Sligh Terms: CASH
Address: Apt B
notes: Sunny has a mean dog
Do not enter unless dog is put up
Then it loops to next customers data and so on.
The main titles never change, such as, ser name, route, address, notes, phone. There is a set number of titles in order; however, the title notes: can take 1 -16 lines; and the header is random throughout the data. and although the titles are in order, address is titled 4 times for both service- line 1 and line 2 and billing addresses- line 1 and line 2.
I would like to set variables to these titles and only take what's after them; the extraction part through PHP. Is there anyway to do this?
I don't think it's possible for a perfect solution, but FWIW, maybe this is good enough for you.
Without a known / reliable delimiter between clients, I can't think of any good way you can get the notes without having the header stuff for the next company included, unless you can do something involving a big lookup table of all client names.
I do have (an ugly) regex that may reliably help as far as the other stuff though:
$content='[the contents of your file]';
preg_match_all('~(Ser Name|Route|Address|Frequency|Week/Day|City State Zip|Sched Time \(HH:MM\)|Ser Phone|Service|Bill to|Rate \(\$\)|Terms|notes):\s*((?:(?!Ser Name|Route|Address|Frequency|Week/Day|City State Zip|Sched Time \(HH:MM\)|Ser Phone|Service|Bill to|Rate \(\$\)|Terms|notes).)+)~is',$content,$matches);
So this basically looks for the "header" and puts into first captured group, and then matches up to the next "header" and puts that into 2nd captured group.
Perhaps this is good enough for you, but TBH I can't think of anything better you can do, unless you can improve your extraction to a better format.
So your example data would output:
Array
(
[0] => Array
(
[0] => Ser Name: Block, Sunny
[1] => Route: 1
[2] => Address: 3354 ASPEN RD.
[3] => Frequency: Monthly
[4] => Address: ST PETE, GA 33333
[5] => Week/Day: First Monday
[6] => City State Zip: data
[7] => Sched Time (HH:MM): 10:00A
[8] => Ser Phone: 555-1212
[9] => Service: BASIC SERVICE
[10] => Bill to: BLOCK,SUNNY
[11] => Rate ($): 24.00
Company Name
Customer Information and Notes
Computed Monday, August 10 2015 Page 2
[12] => Address: 1123 Sligh
[13] => Terms: CASH
[14] => Address: Apt B
[15] => notes: Sunny has a mean dog
)
[1] => Array
(
[0] => Ser Name
[1] => Route
[2] => Address
[3] => Frequency
[4] => Address
[5] => Week/Day
[6] => City State Zip
[7] => Sched Time (HH:MM)
[8] => Ser Phone
[9] => Service
[10] => Bill to
[11] => Rate ($)
[12] => Address
[13] => Terms
[14] => Address
[15] => notes
)
[2] => Array
(
[0] => Block, Sunny
[1] => 1
[2] => 3354 ASPEN RD.
[3] => Monthly
[4] => ST PETE, GA 33333
[5] => First Monday
[6] => data
[7] => 10:00A
[8] => 555-1212
[9] => BASIC SERVICE
[10] => BLOCK,SUNNY
[11] => 24.00
Company Name
Customer Information and Notes
Computed Monday, August 10 2015 Page 2
[12] => 1123 Sligh
[13] => CASH
[14] => Apt B
[15] => Sunny has a mean dog
)
)
Related
I have a multidimensional array in PHP, and want to concatenate a string onto each string element using recursion. The array is as follows:
$array = Array
(
[p] => Array
(
[0] => This Porsche 993 Carrera Cabriolet represents a great opportunity to acquire an open-top variant of one of the most coveted 911 models.
[1] => First registered on 5 August 1994, M912 SGY displays 10,630 miles on the odometer with a clock change at 66,244 miles in 2014.
[2] => The car’s Aventura Green metallic paintwork is reported to be in good condition, presenting well for its age and mileage.
[3] => The Marble Grey leather interior is believed to be entirely original.
[4] => Serviced by Porsche specialist Portiacraft in July 2020 at 76,598 miles, this consisted of an annual oil and filter service.
[5] => The last MOT was undertaken on 6 July 2020 at 76,598 miles.
[6] => It is supplied with a Porsche Club Great Britain folder with records of main dealer and specialist service history.
[7] => This Porsche 911 Carrera Cabriolet presents in highly original and well-maintained condition.
[8] => Summary of maintenance history:
[9] => Array
(
[strong] => The description of this auction lot is, to the best of the seller's knowledge, accurate and not misleading.
)
[10] => Array
(
[strong] => All UK-registered cars and motorbikes on Collecting Cars are run through an online HPI check. This vehicle shows no insurance database markers for damage or theft, and has no finance owing.
)
)
[ul] => Array
(
[li] => Array
(
[0] => 04/11/1996 – 16,120 miles
[1] => 18/11/1998 – 25,086 miles
[2] => 09/09/1999 – 28,769 miles
[3] => 21/02/2000 – 31,469 miles
[4] => 22/06/2001 – 36,055 miles
[5] => 29/10/2002 – 40,781 miles
[6] => 02/03/2005 – 46,238 miles
[7] => 24/03/2006 – 49,459 miles
[8] => 03/07/2007 – 53,051 miles
[9] => 17/12/2008 – 56,582 miles
[10] => 20/05/2010 – 57,385 miles
[11] => 08/06/2011 – 61,653 miles
[12] => 15/05/2012 – 64,425 miles
[13] => 17/04/2013 – 66,026 miles
[14] => 07/06/2014 – 66,244 miles
[15] => 14/09/2015 – 68,411 miles
[16] => 27/02/2018 – 74,856 miles
[17] => 06/08/2019 – ~76,400 miles
[18] => 06/07/2020 – 76,598 miles
)
)
)
Ideally, the result should look like this:
$array = Array
(
[p] => Array
(
[0] => This Porsche 993 Carrera Cabriolet represents a great opportunity to acquire an open-top variant of one of the most coveted 911 models. checked
[1] => First registered on 5 August 1994, M912 SGY displays 10,630 miles on the odometer with a clock change at 66,244 miles in 2014. checked
[2] => The car’s Aventura Green metallic paintwork is reported to be in good condition, presenting well for its age and mileage. checked
[3] => The Marble Grey leather interior is believed to be entirely original. checked
[4] => Serviced by Porsche specialist Portiacraft in July 2020 at 76,598 miles, this consisted of an annual oil and filter service. checked
[5] => The last MOT was undertaken on 6 July 2020 at 76,598 miles. checked
[6] => It is supplied with a Porsche Club Great Britain folder with records of main dealer and specialist service history. checked
[7] => This Porsche 911 Carrera Cabriolet presents in highly original and well-maintained condition. checked
[8] => Summary of maintenance history: checked
[9] => Array
(
[strong] => The description of this auction lot is, to the best of the seller's knowledge, accurate and not misleading. checked
)
[10] => Array
(
[strong] => All UK-registered cars and motorbikes on Collecting Cars are run through an online HPI check. This vehicle shows no insurance database markers for damage or theft, and has no finance owing. checked
)
)
[ul] => Array
(
[li] => Array
(
[0] => 04/11/1996 – 16,120 miles checked
[1] => 18/11/1998 – 25,086 miles checked
[2] => 09/09/1999 – 28,769 miles checked
[3] => 21/02/2000 – 31,469 miles checked
[4] => 22/06/2001 – 36,055 miles checked
[5] => 29/10/2002 – 40,781 miles checked
[6] => 02/03/2005 – 46,238 miles checked
[7] => 24/03/2006 – 49,459 miles checked
[8] => 03/07/2007 – 53,051 miles checked
[9] => 17/12/2008 – 56,582 miles checked
[10] => 20/05/2010 – 57,385 miles checked
[11] => 08/06/2011 – 61,653 miles checked
[12] => 15/05/2012 – 64,425 miles checked
[13] => 17/04/2013 – 66,026 miles checked
[14] => 07/06/2014 – 66,244 miles checked
[15] => 14/09/2015 – 68,411 miles checked
[16] => 27/02/2018 – 74,856 miles checked
[17] => 06/08/2019 – ~76,400 miles checked
[18] => 06/07/2020 – 76,598 miles checked
)
)
)
I have tried the following:
$addedChecked = $this->addCheckedRecursive($array);
private function addCheckedRecursive($array)
{
if(!is_array($array)) {
return $array . ' checked';
}
foreach($array as $v) {
$this->addCheckedRecursive($v);
}
}
and also
$addedChecked = array_walk_recursive($array, function (&$value) {
$value .= ' checked';
});
The latter simply returned true.
For info, every element of each array will always be a string, and I would also like to preserve the current array structure. Any help is appreciated.
There is an in-built function that you can use to achieve what you want.
If you use array_walk_recursive as follows:
// Say you have your array $xmlArray
array_walk_recursive($xmlArray, function (&$value) {
$value .= ' checked';
});
// Since $xmlArray is now modified (in place)
echo '<pre>';
print_r($xmlArray);
echo '</pre>';
In case you would not want $xmlArray to be changed as a side effect, could assign a value copy of the array to a new variable.
$addedChecked = $xmlArray;
array_walk_recursive($addedChecked, function (&$value) {
$value .= ' checked';
});
// Since $addedChecked is now modified (in place)
echo '<pre>';
print_r($addedChecked);
echo '</pre>';
The function takes in the array by reference and will thus modify the array directly as a side effect of the function. This is one important thing to note, it does not return an array, but only whether the function was successfully executed on the array you gave it.
This will loop over each key => value pair and do so recursively if the value is of type array. You can simply concatenate to the value (where we pass value by reference) to update it with checked.
why dont you try array_walk_recursive or array_replace_recursive ?
the docs can be found here
Try it like this:
$addedChecked = $this->addCheckedRecursive($array);
private function addCheckedRecursive($array)
{
if (!is_array($array)) {
return $array . ' checked';
}
else
{
for ($i = 0; $i < count($array); $i++) {
$array[$i] = $this->addCheckedRecursive($array[$i]);
}
return $array;
}
}
I want to create a rank system for users on my website. The ranks will be decided by a number of factors like how long they've been a member, how many posts they created etc. Every data item is also divided by a "weight" determined by me, so that it is more representative of the actual user activity - I don't want 1 post be as significant as 1 day as a member. After the weighing all stats are added together to a total.
Then, I have to normalize the totals so that they are assigned to the ranks which range from 1 to 20, since some members have just a few points of activity and some veteran members have thousands of points. I do this by normalizing the data and scaling it down to the 1-20 rank range with this function:
function normalize($userTotal, $minOriginalRange, $maxOriginalRange, $minNewRange, $maxNewRange){
return $minNewRange + ((($maxNewRange - $minNewRange) * ($originalValue - $minOriginalRange)) / ($maxOriginalRange - $minOriginalRange));
}
This is usually called like so:
normalize(getUserTotal(), 0, getHighestTotalOfAllMembers(), 1, 20);
And so I got this as a result, key is rank and value is number of members who would get that rank:
Array
(
[1] => 7418
[2] => 1918
[3] => 289
[4] => 102
[5] => 62
[6] => 28
[7] => 21
[8] => 14
[9] => 1
[10] => 8
[11] => 6
[12] => 5
[13] => 1
[14] => 1
[17] => 1
[20] => 1
)
As you can see there are tons of users who are ranked low and very few who get assigned the mid and high ranks. I'd like to fix this by calculating the rank assigned using a logarithmic scale, so that it is easy to climb the ranks in the lower tiers and gets harder and harder the higher you go. That way it should spread out more evenly and more users will have ranks in the middle.
I don't know how to approach this however, I have never used logarithmic scales and always resorted to simple arithmetic in my code.
You would use a php math logarithm function and map it over the final array, for example:
function logfunction($v){
return round(log1p($v),2);
}
$simple_array = [7418, 1918, 289, 102, 62, 28, 21, 14, 1, 8, 6, 5, 1, 1, 1];
$logarithmic_array = array_map(logfunction, $simple_array);
print_r($logarithmic_array);
In the above, I use the log1p() function whichreturns log(1 + number) computed in a way that is accurate even when the value of number is close to zero (See: http://php.net/manual/en/function.log1p.php). Then I round the result to 2 decimal places for the sake of readability. The resulting $logarithmic_array output is:
Array
(
[0] => 8.91
[1] => 7.56
[2] => 5.67
[3] => 4.63
[4] => 4.14
[5] => 3.37
[6] => 3.09
[7] => 2.71
[8] => 0.69
[9] => 2.2
[10] => 1.95
[11] => 1.79
[12] => 0.69
[13] => 0.69
[14] => 0.69
)
I have the following PHP regex:
#<tr[\s\S]*?<a class="b1"[\s\S]*?<em[^>]*>([^<]*)[\s\S]*?stars_small_([0-9].[0-9])#
Which I am using on this site:
Gamespy
I get back this data:
[1] => Array
(
[0] => AC/DC Live: Rock Band Track Pack
[1] => Ace Combat 6: Fires of Liberation
[2] => All-Pro Football 2K8
[3] => Alone in the Dark
[4] => Armored Core 4
[5] => Army of Two
[6] => Army of Two: The 40th Day
)
[2] => Array
(
[0] => 3.5
[1] => 2.5
[2] => 3.5
[3] => 3.5
[4] => 2.5
[5] => 3.5
[6] => 3.5
)
This is what I am looking for, however I don't seem to be getting back all of the data. I should get the following Titles with scores. But for some reason I am only getting some of them.
AC/DC Live: Rock Band Track Pack
Ace Combat 6: Fires of Liberation
Afro Samurai
Alan Wake
Aliens vs. Predator
All-Pro Football 2K8
Alone in the Dark
Amped 3
Armored Core 4
Army of Two
Army of Two: The 40th Day
Assassin's Creed
Assassin's Creed II
Assassin's Creed: Brotherhood
Avatar: The Game
I have tested my regex here:
http://www.solmetra.com/scripts/regex/index.php
Using this HTML:
http://justpaste.it/20u5
Any help explaining why I am only getting back some of the results would be greatly appreciated. Thanks
Change the sub-pattern stars_small_([0-9].[0-9]) to stars_small_([0-9](?:\.[0-9])?) as some of the urls only have one digit in the SRC attribute of the IMG tag.
I'm trying to look up the artist BIO information with the LASTFM api but I'm having trouble.
I'm using PHP and a CURL request that's returning the result as XML.
If I use the url that gets sent by CURL and just load it normally in the browser it show's everything as desired. However, the result returned by CURL in the php script is missing certain properties of the XML.
For example: artist->bio->summary is there but with no content.
You can replicate what I'm doing ill copy the basic concepts here:
open this in you browser:
http://ws.audioscrobbler.com/2.0/artist/cher/info.xml
copy and paste this into a PHP file and open:
$url = 'http://ws.audioscrobbler.com/2.0/artist/cher/info.xml';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$retData = curl_exec($ch);
curl_close($ch);
echo '<pre>';
echo $retData;
echo '</pre>';
You'll see that the returned results are similar but with missing content in the curl request. I've also tried doing this a simplexml_load_file() but the same happens. What am I missing? Cheers for any help!
Try to replace
echo $retData;
with
echo htmlspecialchars($retData);
and you'll see that everything is there. You're printing raw XML in an HTML context, and some of the tags in the XML are interpreted as HTML tags.
The url is wrong but that could be a typo ;p. The reason its content is missing is the <![CDATA[ tag, strip it before parsing and you should be good to go.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://ws.audioscrobbler.com/2.0/artist/cher/info.xml');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$retData = curl_exec($ch);
$retData = str_replace(array('<![CDATA[',']]>'),'',$retData);
$xml = simplexml_load_string($retData);
$lastFM = json_decode(json_encode($xml),TRUE);
print_r($lastFM);
/*Array
(
[name] => Cher
[mbid] => bfcc6d75-a6a5-4bc6-8282-47aec8531818
[url] => http://www.last.fm/music/Cher
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/63530405.png
[1] => http://userserve-ak.last.fm/serve/64/63530405.png
[2] => http://userserve-ak.last.fm/serve/126/63530405.png
[3] => http://userserve-ak.last.fm/serve/252/63530405.png
[4] => http://userserve-ak.last.fm/serve/500/63530405/Cher.png
)
[streamable] => 1
[stats] => Array
(
[listeners] => 768175
[playcount] => 7895613
)
[similar] => Array
(
[artist] => Array
(
[0] => Array
(
[name] => Sonny & Cher
[url] => http://www.last.fm/music/Sonny+&+Cher
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/71168880.png
[1] => http://userserve-ak.last.fm/serve/64/71168880.png
[2] => http://userserve-ak.last.fm/serve/126/71168880.png
[3] => http://userserve-ak.last.fm/serve/252/71168880.png
[4] => http://userserve-ak.last.fm/serve/500/71168880/Sonny++Cher.png
)
)
[1] => Array
(
[name] => Cyndi Lauper
[url] => http://www.last.fm/music/Cyndi+Lauper
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/76056286.png
[1] => http://userserve-ak.last.fm/serve/64/76056286.png
[2] => http://userserve-ak.last.fm/serve/126/76056286.png
[3] => http://userserve-ak.last.fm/serve/252/76056286.png
[4] => http://userserve-ak.last.fm/serve/_/76056286/Cyndi+Lauper++for+Uniqlo.png
)
)
[2] => Array
(
[name] => Madonna
[url] => http://www.last.fm/music/Madonna
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/78270650.png
[1] => http://userserve-ak.last.fm/serve/64/78270650.png
[2] => http://userserve-ak.last.fm/serve/126/78270650.png
[3] => http://userserve-ak.last.fm/serve/252/78270650.png
[4] => http://userserve-ak.last.fm/serve/_/78270650/Madonna+Shes+a+bad+girl.png
)
)
[3] => Array
(
[name] => Kylie Minogue
[url] => http://www.last.fm/music/Kylie+Minogue
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/78217522.png
[1] => http://userserve-ak.last.fm/serve/64/78217522.png
[2] => http://userserve-ak.last.fm/serve/126/78217522.png
[3] => http://userserve-ak.last.fm/serve/252/78217522.png
[4] => http://userserve-ak.last.fm/serve/500/78217522/Kylie+Minogue+KylieBestOf.png
)
)
[4] => Array
(
[name] => Tina Turner
[url] => http://www.last.fm/music/Tina+Turner
[image] => Array
(
[0] => http://userserve-ak.last.fm/serve/34/74998404.jpg
[1] => http://userserve-ak.last.fm/serve/64/74998404.jpg
[2] => http://userserve-ak.last.fm/serve/126/74998404.jpg
[3] => http://userserve-ak.last.fm/serve/252/74998404.jpg
[4] => http://userserve-ak.last.fm/serve/_/74998404/Tina+Turner+Queen+3.jpg
)
)
)
)
[tags] => Array
(
[tag] => Array
(
[0] => Array
(
[name] => pop
[url] => http://www.last.fm/tag/pop
)
[1] => Array
(
[name] => female vocalists
[url] => http://www.last.fm/tag/female%20vocalists
)
[2] => Array
(
[name] => 80s
[url] => http://www.last.fm/tag/80s
)
[3] => Array
(
[name] => dance
[url] => http://www.last.fm/tag/dance
)
[4] => Array
(
[name] => rock
[url] => http://www.last.fm/tag/rock
)
)
)
[bio] => Array
(
[published] => Tue, 1 May 2012 12:51:56 +0000
[summary] => Cher (born Cherilyn Sarkisian on May 20, 1946) is an American singer, actress, songwriter, author and entertainer. Among her many career accomplishments in music, television and film, she has won an Academy Award, a Grammy Award, an Emmy Award and three Golden Globe Awards among others. Referred to as the Goddess of Pop, Cher first rose to prominence in 1965 as one half of the pop/rock duo Sonny & Cher.
[content] => Cher (born Cherilyn Sarkisian on May 20, 1946) is an American singer, actress, songwriter, author and entertainer. Among her many career accomplishments in music, television and film, she has won an Academy Award, a Grammy Award, an Emmy Award and three Golden Globe Awards among others.
Referred to as the Goddess of Pop, Cher first rose to prominence in 1965 as one half of the pop/rock duo Sonny & Cher. She also established herself as a solo recording artist, releasing 25 albums, contributing to numerous compilations, and tallying 34 Billboard Top 40 entries over her career, both solo and with Sonny. These include eighteen Top 10 singles and five number one singles (four solo). Cher has had 16 top ten hits in the UK between 1965 and 2003, four of which reached number one (two solo, one with Sonny, one as part of a charity single).
In a career surpassing 40 years, Cher has been described as an enduring pop icon and one of the most popular female artists in music history. Since her debut in 1964, Cher has sold as a solo artist over 180 million records worldwide and an estimated 70 million singles and with duo Sonny and Cher over 80 million records becoming one of the biggest-selling artists of all time.
She became a television star in the 1970s and a film actress in the 1980s. In 1987, she won the Academy Award for Best Actress for her role in the romantic comedy Moonstruck.
During 2007, in the seventh volume of Chrome Hearts, Cher once again confirmed that she is working on her twenty-sixth studio album. No recordings have taken place as of yet, and no release date had been scheduled.
It is rumoured that Cher will collaborate with Lady Gaga in a song for her next album Born This Way. This album is expected to be released in Spring 2011.
On February 7, 2008 Cher, at 61, announced that she had reached a deal to perform 200 shows over three years live at the Colosseum at Caesar's Palace in Las Vegas. Her new show, entitled Cher at the Colosseum, debuted on May 6, 2008. The show reportedly includes 18 dancers, 4 aerialists, and multiple costumes designed by Bob Mackie. Choreography will be directed by Doriana Sanchez who also worked with Cher on her past three major tours. Her show will perform four nights a week for a month, and a second leg of the show will continue in August. Cher will share the stage on a rotating basis with contemporaries Bette Midler (whose The Showgirl Must Go On opened on February 20, 2008) and Elton John (whose The Red Piano which opened in 2004, will continues its run of about 50 shows a year).
Cher made her musical debut and first film role in a decade in , starring alongside Christina Aguilera, who also made her musical and film debut. The film was released in November 2010.
User-contributed text is available under the Creative Commons By-SA License and may also be available under the GNU FDL.
)
)
*/
i use imdb api
$homepage = file_get_contents('http://www.imdbapi.com/?i='.$imdbID);
$arr = json_decode($homepage);
In $arr i have all data about related movie.
Maguire [Year] => 1996 [Rated] => R [Released] => 13 Dec 1996 [Genre] => Comedy, Drama, Romance, Sport [Director] => Cameron Crowe [Writer] => Cameron Crowe [Actors] => Tom Cruise, Cuba Gooding Jr., Renée Zellweger, Kelly Preston [Plot] => When a sports agent has a moral epiphany and is fired for expressing it, he decides to put his new philosophy to the test as an independent with the only athlete who stays with him. [Poster] => http://ia.media-imdb.com/images/M/MV5BMTkxNjc2NjQwOF5BMl5BanBnXkFtZTcwMDE2NDU2MQ##._V1_SX320.jpg [Runtime] => 2 hrs 19 mins [Rating] => 7.2 [Votes] => 97329 [ID] => tt0116695 [Response] => True )
what i want is that reaching specified key's value.
Is there a function like that? For example , i will give the key=> Actors and get all actors?
:/ Like this?
$homepage = file_get_contents('http://www.imdbapi.com/?i='.$imdbID);
$arr = json_decode($homepage, true);
print($arr['Actors']);