solved | function > doesn't return data
Posted: Tue Aug 25, 2009 8:23 am
Hello,
I have a function that, when run completely, doesn't return it's data to the page from which it is called. The tricky part is, that if I put a die(); in at the end of the function, it is getting through it completely and spitting out the last value.
so... echo $string = ... outputs in the source when the function has a die.
this is on the page calling the function:
any ideas why it won't return to the template?
thank you very much.
I have a function that, when run completely, doesn't return it's data to the page from which it is called. The tricky part is, that if I put a die(); in at the end of the function, it is getting through it completely and spitting out the last value.
Code: Select all
function getPath($url) {
$parsed = parse_url($url);
$trimmed = ltrim($parsed['path'], '/');
$parts = explode('/', $trimmed);
foreach($parts as $part){
if (!is_numeric($part)){
$combined_parts[] = $part;
} elseif(is_numeric($part)) {
break;
}
}
$string = implode(':', $combined_parts);
return $string;
}this is on the page calling the function:
Code: Select all
<?php
# DFP Omniture Tagging
getDOTPath($_server['REQUEST_URI']."/hockey/nhl/maple_leafs/");
?>
thank you very much.