Hi Sam,
You have to add line $str_format = str_replace(array(" & # 0 3 8 ;"," & a m p ;"), "&", $xmlurl);
into your function to fix this.
Updated function :
function willhill_text($atts) {
extract( shortcode_atts( array(
"xmlurl"=>'http://'),
$atts
)
);
// Remove spaces from " & # 0 3 8 ;"," & a m p ;"
$str_format = str_replace(array(" & # 0 3 8 ;"," & a m p ;"), "&", $xmlurl);
$rss = simplexml_load_file(esc_url_raw($str_format));
print_r($rss);
}
add_shortcode('willhill_text_link', 'willhill_text');
Pastie.org URL : http://pastie.org/private/hjtfgnqsbzfanfdhumemw
I hope this helps.
~ Dipak G.