Skip to content

Instantly share code, notes, and snippets.

<?php
$html = file_get_contents('http://nothnagle.travidia.com/ROP/Ads.aspx?advid=1105344');
preg_match('@<img.+class="adimg".+src="(.*)".*>@Uims', $html, $matches);
$image = $matches[1];
$items['user/%user/billing'] = array(
'title' => 'Billing',
'page callback' => 'drupal_get_form',
'page arguments' => array('easy_accounts_billing', 1),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
@ceejayoz
ceejayoz / gist:139687
Created July 2, 2009 20:15
Removes nasty MS Word characters from HTML content.
$text = str_replace(chr(130), ',', $text); // baseline single quote
$text = str_replace(chr(132), '"', $text); // baseline double quote
$text = str_replace(chr(133), '...', $text); // ellipsis
$text = str_replace(chr(145), "'", $text); // left single quote
$text = str_replace(chr(146), "'", $text); // right single quote
$text = str_replace(chr(147), '"', $text); // left double quote
$text = str_replace(chr(148), '"', $text); // right double quote
$text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
<?php
function budget_theme_registry_alter(&$theme_registry) {
$theme_hook = 'node';
$modulepath = drupal_get_path('module', 'budget');
array_unshift($theme_registry[$theme_hook]['theme paths'], $modulepath);
}
?>