Hello i have a an application that needs to decide whether to treat a flow of structured data as json or as xml tree based on an anlysis of an url that it calls that should ends by .json or .xml
i have this piece of code, does that do the trick?
if (preg_match('#\.([^\.])$#', $url, $format)) {
$format = $format[1];
} else {
$format = 'xml';
}
thanks in advance
Regards



Reply With Quote



Bookmarks