function _shorten_xml in Shorten URLs 6
Same name and namespace in other branches
- 8.2 shorten.module \_shorten_xml()
- 8 shorten.module \_shorten_xml()
- 7.2 shorten.module \_shorten_xml()
- 7 shorten.module \_shorten_xml()
Parses the value between tags in an XML document.
Parameters
$xml: The contents of the XML document.
$tag: The tag to get the value from.
Return value
The value from the specified tag, typically an abbreviated URL.
1 call to _shorten_xml()
- shorten_fetch in ./
shorten.module - Downloads the response of the URL abbreviation service.
File
- ./
shorten.module, line 382 - Shortens URLs via external services.
Code
function _shorten_xml($xml, $tag) {
$start = strpos($xml, $tag) + drupal_strlen($tag) + 1;
$end = strpos($xml, $tag, $start + 1) - 2;
$length = -(drupal_strlen($xml) - $end);
return drupal_substr($xml, $start, $length);
}