browser lang:en
Una pratica libreria di funzioni PHP che servono ad identificare un particolare testo nelle stringhe e di conseguenza ad operare su di esso
after ('@', 'boris@holyguard.net');
ritorna 'holyguard.net'
dalla prima occorrenza di '@'
before ('@', 'boris@holyguard.net');
ritorna 'boris'
dalla prima occorrenza di of '@'
between ('@', '.', 'boris@holyguard.net');
ritorna 'holyguard'
dalla prima occorrenza di '@'
after_last ('[', 'sin[90]*cos[180]');
ritorna '180]'
dalla ultima occorrenza di '['
before_last ('[', 'sin[90]*cos[180]');
ritorna 'sin[90]*cos['
dalla ultima occorrenza di '['
between_last ('[', ']', 'sin[90]*cos[180]');
ritorna '180'
dalla ultima occorrenza di '['
function after ($this, $inthat)
{
if (!is_bool(strpos($inthat, $this)))
return substr($inthat, strpos($inthat,$this)+strlen($this));
};
function after_last ($this, $inthat)
{
if (!is_bool(strrevpos($inthat, $this)))
return substr($inthat, strrevpos($inthat, $this)+strlen($this));
};
function before ($this, $inthat)
{
return substr($inthat, 0, strpos($inthat, $this));
};
function before_last ($this, $inthat)
{''
return substr($inthat, 0, strrevpos($inthat, $this));
};
function between ($this, $that, $inthat)
{
return before($that, after($this, $inthat));
};
function between_last ($this, $that, $inthat)
{
return after_last($this, before_last($that, $inthat));
};
//posizione stringa al contrario
function strrevpos($instr, $needle)
{
$rev_pos = strpos (strrev($instr), strrev($needle));
if ($rev_pos===false) return false;
else return strlen($instr) - $rev_pos - strlen($needle);
};
//multiple ricerche delle stringhe comprese
function multi_between($this, $that, $inthat)
{
$counter = 0;
while ($inthat)
{
$counter++;
$elements[$counter] = before($that, $inthat);
$elements[$counter] = after($this, $elements[$counter]);
$inthat = after($that, $inthat);
}
return $elements;
}
Con l'avvento di caffeine molti webmaster si sono trovati a dover rivedere tutte le strategie SEO per i…
in:Scripts e tutorials (0 commenti)test
in:PHP Scripts (0 commenti)Artweaver è un programma di disegno dotato di un'infinità di pennelli con cui sperimentare nuove tecniche grafiche.…
in:Software Open Source (0 commenti)Con Bind, la configurazione di domini e sottodomini è abbastanza semplice....l'elemento più importante è il cosidetto zone-file, che…
in:Apache (0 commenti)hkit é un tool, o meglio, una classe in PHP5 per la estrazione dei piú comuni microformati. La pagina…
in:PHP Scripts (0 commenti)Dopo circa un anno ho ritirato i certificati che attestano i miei corsi di Java...purtroppo manca il terzo…
in:Blog (3 commenti)SVNWeaver é una estensione per Dreamweaver che permette di integrare il TortoiseSVN nei menú del Dreamweaver. Devo dire…
in:Applicazioni di sviluppo web (0 commenti)Questo è un widget di jQuery per il nuovo social network di Google-Buzz-che è possibile incorporare ovunque per…
in:Scripts e tutorials (0 commenti)
