Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > PHP Programming
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-20-2009, 04:56 PM
  #1
harpster
Fighter (Level 4)
 
Join Date: Feb 2007
Posts: 36
iTrader: (0)
harpster is an unknown quantity at this point
need to add titles and stories to an array

hello,

i'd like to add a news xml to an array in php. i already have the code where i have searched out the targets, but i can't figure out what functions need to take place to get the story with the title and how to echo them. right now my code is just everything jammed together with some crazy array-type numbers.

thanks!

Code:
<body>
<?php

$url = 'http://www.medicalnewstoday.com/rss/nursing.xml';
$xml = simplexml_load_file($url);
echo( $xml->channel->title);
echo "<br>";

$result\ = $xml->xpath('/rss/channel/item/title');
while(list( , $title) = each($result)) 
{
    $arrTitle[] = $title;
}

$result2\ = $xml->xpath('/rss/channel/item/description');
while(list( , $story) = each($result2)) 
{
	$arrStory[] = $story;
}

print_r($arrStory);


?>
</body>
here is my output
harpster is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-21-2009, 09:23 AM
  #2
harpster
Fighter (Level 4)
 
Join Date: Feb 2007
Posts: 36
iTrader: (0)
harpster is an unknown quantity at this point
the output was too long, but here is a snippet...

HTML Code:
Nursing / Midwifery News From Medical News Today
Array ( [0] => SimpleXMLElement Object ( [0] => I've wanted to be a nurse since I was in the third grade, so it was no surprise when I graduated from Howard University with a Bachelor of Science in Nursing. During my undergraduate clinical rotations, I'd fell in love with maternal/child health and that's where I started my career. Back then, I had no idea that my path would eventually lead me to Environmental Health Nursing (EHN). ) [1] => SimpleXMLElement Object ( [0] => As many as 16,000 registered nurses from three large Catholic hospital chains in California and Nevada will join a one-day strike and picket October 30, as RNs step up the protest over poor readiness by many hospitals to confront the H1N1 swine flu pandemic, the California Nurses Association/National Nurses Organizing Committee (CNA/NNOC) announced today. ) [2] => SimpleXMLElement Object ( [0] => More than 16,000 registered nurses are locked in a contract dispute with officials at 37 Catholic hospitals statewide and plan to strike Oct. 30 out of concern that the hospitals' lax safety standards put them at risk of catching H1N1 flu. The California Nurses Assn., which is in bargaining talks with San Francisco-based Catholic Healthcare West hospitals, announced the strike this morning. Local hospitals expected to be affected include California Hospital Medical Center, St. ) [3] => SimpleXMLElement Object ( [0] => The RCN today (19 October) calls for guaranteed safe staffing levels as it reveals that four in ten nurses (42%) say that short staffing compromises patient care at least once or twice a week. The call comes in the RCN's manifesto to all political parties issued ahead of the next general election. The RCN is publishing its 2009 Employment Survey to coincide with the manifesto, which highlights how pressures on workload and staffing levels can impact on patient care. ) [4] => SimpleXMLElement Object ( [0] => Few people have thought about providing an exercise workout in the intensive care unit, especially for patients on ventilators - even those who are comatose - but a researcher from Frances Payne Bolton School of Nursing at Case Western Reserve University will be doing some bedside coaching and exercising to get patients stretching and flexing their muscles. ) [5] => SimpleXMLElement Object ( [0] => The number of nurses employed in health increased by 11% between 2003 and 2007 but, unlike their medical counterparts, nurses are working longer hours, and the ageing of the workforce poses challenges for Australia's healthcare system the ANF said today. Responding to the release of the Australian Institute of Health and Welfare Nursing and Midwifery labour force 2007 report, ANF Federal Secretary Ged Kearney said a 7. ) [6] => SimpleXMLElement Object ( [0] => The American Nurses Association (ANA) was on Capitol Hill Thursday to testify before the House Transportation Committee in support of environmental reform legislation. Patricia Butterfield, PhD, RN of the Washington State Nurses Association (WSNA) spoke on behalf of ANA at the hearing on the "The Clean Water Act after 37 Years: Recommitting to the Protection of the Nation's Waters. ) [7] => SimpleXMLElement Object ( [0] => In excess of 15,000 charters signed by the community and aged care workers calling on the Federal Government to properly fund aged care were handed over to the Federal Minister for Ageing, Justine Elliot MP today at Amaroo Aged Care Facility in Tweed Heads. Ged Kearney, Federal Secretary of the Australian Nursing Federation (ANF) said thousands of concerned people had signed the ANF's "Charter for Quality Aged Care". ) [8] => SimpleXMLElement Object ( [0] => The Royal College of Nursing (RCN) responded to the latest NHS performance ratings, published by the Care Quality Commission (CQC). These are the final ratings to be published by the CQC before all trusts will have to meet new registrations requirements in order to continue to deliver care. The ratings show that performance has improved in many areas, from reducing infections to waiting times for surgery. ) [9] => SimpleXMLElement Object ( [0] => According to a report released Tuesday, policies set by the International Monetary Fund (IMF) have restricted government spending on health services, "denying sick Kenyans access to drugs and quality healthcare," Business Daily reports. ) [10] => SimpleXMLElement Object ( [0] => The Gerontological Society of America (GSA) - the nation's largest interdisciplinary organization devoted to the field of aging - has chosen Mathy Mezey, EdD, RN, FAAN, of New York University (NYU) as the recipient of the 2009 Doris Schwartz Gerontological Nursing Research Award. This distinguished honor, presented by GSA's Health Sciences Section in collaboration with the John A. ) [11] => SimpleXMLElement Object ( [0] => The Australian Nursing Federation called for a long term health care strategy to address the pressure on public hospitals, in response to the AMA's report card on public hospitals. ANF Federal Secretary Ged Kearney said that nurses are feeling the pressure and stress of working in a health care system that has been chronically under-resourced. ) [12] => SimpleXMLElement Object ( [0] => Senator Steve Fielding has offended more than 300,000 nurses and midwives in Australia by suggesting they are not able to provide high quality care in the community. ANF Federal Secretary Ged Kearney said Senator Fielding had displayed a lack of understanding of legislation before the Senate that will allow nurse practitioners and eligible midwives access to the PBS and MBS. ) [13] => SimpleXMLElement Object ( [0] => The next meeting of the Cross-Party Assembly Group on Nursing, chaired by Val Lloyd AM, will focus on the role of Health Care Support Workers (HCSWs) in healthcare. Health Care Support Workers or Health Care Assistants are an intrinsic and growing part of our healthcare workforce but often there is confusion over what this role means in practice and is often an undervalued and low paid role. ) [14] => SimpleXMLElement Object ( [0] => The nation's largest organization of registered nurses condemned the latest campaign by the insurance industry, threatening massive increases in premium rates if it does not get its way on the healthcare bills currently before Congress. America's Health Insurance Plans (AHIP), the insurance industry trade lobby, Sunday released a report it commissioned, warning average family premiums will go up to $21,300 if the Senate Finance Committee bill is adopted. ) [15] => SimpleXMLElement Object ( [0] => The NMC and the Royal College of Nursing (RCN) are pleased to announce a settlement in the case of nurse Margaret Haywood. This was an extremely difficult and complex case in which the NMC panel had to balance Ms Haywood's duty to protect patient confidentiality with her duty to raise concerns about poor standards of care. The court has approved the replacement of the striking off order with a one year caution. ) [16] => SimpleXMLElement Object ( [0] =>
harpster is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-23-2009, 09:09 AM
  #3
Vege
Super Deity (Level 18)
 
Join Date: Sep 2004
Location: Finland
Posts: 3,410
iTrader: (0)
Vege is just really niceVege is just really niceVege is just really niceVege is just really nice
Can you show example of the xml and how you wan't it to look on the page?
It shouln't be more than few lines and im happy to write it down for you if you provide what i ask
Vege is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 10:22 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.