Jump to content

maddogandnoriko

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maddogandnoriko's Achievements

Member

Member (2/5)

0

Reputation

  1. I am writing a script that converts php pages to html pages for mobile devices with no net connection. I have an multi-dimensional array of urls and their replacement values: $links=array($phpURL,$fixedURL); Can I break this into two arrays, one containing all $phpURL's and another array containing all $fixedURL's? Here is what I am ultimately trying to do, if there is a cleaner way of doing it by all meansplease let me know. $text=str_replace($phpURLarray, $fixedURLarray, $text); Thank you once again for rescuing me from myself, Todd
  2. Can I get the third element of an array regardless of it's key name? For example I have an $example array: Array ( [3] => European_SIB_Association [4] => andrew1.jpg [5] => andrew2.jpg [6] => andrew3.jpg [7] => andrew4.jpg [8] => artem ) How can I get the second element even though it is named four? Thank you, Todd
  3. I've narrowed my problem a bit. I am pretty sure it is a path problem.....the problem is this may not always run from my localhost. Any ideas? this works: wwwcopy('http://localhost:8888/bluenose/index.php', 'html/bluenose/index.html'); This does not: wwwcopy('./bluenose/index.php', 'html/bluenose/index.html'); Todd
  4. pretty much view source but I have a list of files to do and wanted a separate script to get the html from them. But yes, the same as view source in my browser. todd
  5. I have some pages that have pretty basic php in them to include common sidebars and the site title and footer etc. I am trying to generate static html from said pages for transfer to a portable device w/o internet connection. I was using the following function, but it is just copying the php files, when I want to copy the generated html. Thank you Todd function wwwcopy($link,$file){ $content=''; $fp = @fopen($link,"r"); while(!feof($fp)){ $content.= fread($fp,1024); } fclose($fp); $content=replace_filenames($content); $fp2 = @fopen($file,"w"); fwrite($fp2,$content); fclose($fp2); }
  6. exactly what was needed! Thank you very much. Todd
  7. I have an array that has had elements removed so the keys are as such: 3,4,6,9 etc. I now need to retrieve a specific range of elements for pagination, ie. 0-10, is it possible to just renumber the keys 0-whatever? Thank you Todd
  8. I have an xml file loaded into a simplexml object. The xml has a "ö" in it and is getting garbled in the simplexml object. Here is my test code: <?php $seriesURL='http://www.thetvdb.com/api/GetSeries.php?seriesname=krod'; echo 'SeriesURL:'.$seriesURL.'<br><br>'; $data = simplexml_load_file($seriesURL); echo '<br><br>'. ($data->Series->SeriesName); ?> The resulting Series Name is: Kröd Mändoon and the Flaming Sword of Fire
  9. To me it seems like most are using or converting to oop now. I am working on a project that requires xml usage and it is now built in and the parsed xml is returned as an object...just one example I am sure. maddogandnoriko
  10. That did it! Also the following also worked, added quotes. "$series->SeriesName" Thank you so much, maddogandnoriko
  11. I have an xml page loaded into a simplexml object. I am trying to create an array of SeriesNames from the simple xml object to pass to smarty. When I add a SeriesName to the $shows array, it adds it as an object not as the elements text value. PHP: $counter=0; $shows=array(); $seriesURL='http://www.thetvdb.com/api/GetSeries.php?seriesname=bones'; $data = simplexml_load_file($seriesURL); foreach($data->Series as $series){ $shows["$counter"]['name']=$series->SeriesName; $counter++; } The XML: <Data> − <Series> <seriesid>75682</seriesid> <language>en</language> <SeriesName>Bones</SeriesName> <banner>graphical/75682-g3.jpg</banner> − <Overview> Dr. Temperance Brennan is a highly skilled forensic anthropologist at the Jeffersonian Institute in Washington, DC. When the standard methods of identifying a body are useless - when the remains are so badly decomposed, burned or destroyed that CSI gives up - law enforcement calls in Brennan for her uncanny ability to read clues left behind in the victim's bones. Special agent Seeley Booth of the FBI's Homicide Investigations Unit is the exception. A former Army sniper, Booth mistrusts science and scientists - the "squints," as he calls them -- who pore over the physical evidence of a crime. </Overview> <FirstAired>2005-09-13</FirstAired> <IMDB_ID>tt0460627</IMDB_ID> <zap2it_id>SH754201</zap2it_id> <id>75682</id> </Series> − <Series> <seriesid>76818</seriesid> <language>en</language> <SeriesName>Hearts and Bones</SeriesName> − <Overview> Hearts and Bones series one is a seven-part one-hour drama which explores the lives, loves and careers of a group of friends from Coventry who all move to London. Emma is in a seven year relationship with Mark Rose, with whom she has a son Sam. She marries him although she loves his brother Rich-a butcher. Rich lives with his girlfriend Louise who is a hairdresser but he finds the temptation of a dalliance with Emma hard to resist especially when his relationship with Louise comes under strain when Louise's mother becomes ill. There is also Emma's best pal Amanda who's single since splitting up with her investment banker boyfriend Michael; Romance novel writer Sinead is besotted with Mark but turns to the Internet for love when he marries Emma. Series two picks up the story three months on. Mark has left and Emma and Rich haven't spoken since their affair. Emma is being shunned by Michael and Sinead. Michael is once more estranged from Amanda. Only Emma, Amanda and Louis </Overview> <FirstAired>2000-07-01</FirstAired> <id>76818</id> </Series> − <Series> <seriesid>70881</seriesid> <language>en</language> <SeriesName>Fitz and Bones</SeriesName> <FirstAired>1981-10-01</FirstAired> <id>70881</id> </Series> </Data> Here is the array I end up with including the unwanted simplexml objects: Array ( [0] => Array ( [name] => SimpleXMLElement Object ( [0] => Bones ) ) [1] => Array ( [name] => SimpleXMLElement Object ( [0] => Hearts and Bones ) ) [2] => Array ( [name] => SimpleXMLElement Object ( [0] => Fitz and Bones ) ) )
  12. It is happening when I import it into the xml object, I think. Sorry to have muckec this thread up so bad...... For this xml url:http://www.thetvdb.com/api/GetSeries.php?seriesname=krod The xml: <Data> − <Series> <seriesid>88631</seriesid> <language>en</language> <SeriesName>Kröd Mändoon and the Flaming Sword of Fire</SeriesName> <banner>graphical/88631-g2.jpg</banner> − <Overview> The series follows a reluctant hero named Kröd Mändoon. The often underconfident freedom fighter is the last great hope in the struggle against an evil ruler known as Chancellor Dongalor. To help in his fight, Kröd has assembled a band of remarkably useless fighters. Together, they must overcome a variety of evil obstacles in a quest to save their world. </Overview> <FirstAired>2009-04-09</FirstAired> <id>88631</id> </Series> </Data> the simplexml object(as print_r'd): Array ( [series] => Array ( [seriesid] => 88631 [language] => en [seriesName] => Kröd Mändoon and the Flaming Sword of Fire [banner] => graphical/88631-g2.jpg [Overview] => The series follows a reluctant hero named Kröd Mändoon. The often underconfident freedom fighter is the last great hope in the struggle against an evil ruler known as Chancellor Dongalor. To help in his fight, Kröd has assembled a band of remarkably useless fighters. Together, they must overcome a variety of evil obstacles in a quest to save their world. [FirstAired] => 2009-04-09 [id] => 88631 ) )
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.