Jump to content

Kane250

Members
  • Posts

    230
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Kane250's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Gotcha! I ended up including the file via the file system and I turned my code into a function that I just query after inclusion to get my data. This seems to be working perfectly. Thanks everyone!
  2. Hi all, I'm at a dead-end here. I have a php file that I can query to return an array containing a bunch of data about a job listing. I include and query it by calling it like so within another file on my site. Quick Notes: The original file is in a different directory on my site than the page it's being included in. I have tried returning the array at the end of the script. I can print_r the array on the page I'm including the script on (so the URL path is correct). If I go to this URL directly and print_r on the array, I see the entire array as expected. Also, if I include the file on page 2 like I did above with print_r on the array in the original file, I see the array printed out on page 2. include 'http://www.example.com/php/job-details.php?job=jobname&city=thecity'; However, if I do not print_r on the array in the original file and just include it on page 2, I cannot do anything with it and the array variable isn't found. Is this a case of variable scope? I'm so frustrated... Here is the code I have in my original file: <? include('functions.php'); $jobtitlematch = $_GET["job"]; $jobcitymatch = $_GET["city"]; //echo $jobtitlematch; //echo $jobcitymatch; $url = 'http://somesite.com/something'; $xml = simplexml_load_file($url); foreach($xml->job as $job) { $jobtitle = makeURL((string)$job->title); $jobcity = makeURL((string)$job->region); if ($jobtitle == $jobtitlematch && $jobcity == $jobcitymatch) { $jobdata[] = array( Title => ((string)$job->title), URL_Title => makeURL((string)$job->title), Location => ((string)$job->region), URL_Location => makeURL((string)$job->region), Department => ((string)$job->department), URL_Department => makeURL((string)$job->department), Overview => ((string)$job->joboverview), Responsibilities => ((string)$job->responsibilities), Qualifications => ((string)$job->qualifications), Keywords => ((string)$job->metakeywords) ); } return $jobdata; //I have also tried return global $jobdata; } print_r($jobdata); ?> Thanks in advance for any help you can provide...
  3. Ahh, that did the trick! Thanks!
  4. Well the website it's being displayed on is in a UTF-8 character set. Is it easy to convert?
  5. I get this output: Items Array ( [0] => � the first thing � the second thing � the third thing � etc � etc )
  6. Did you test that? For me it just throws everything into the first array index...
  7. Any way to explode on bullets? I know it's a special character, but I can't figure it out $manyItems = "• the first thing • the second thing • the third thing • etc • etc"; //This doesn't work $items = explode("•", $manyItems); //Neither does this $items = explode("•", $manyItems); Any suggestions? Thanks in advance!
×
×
  • 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.