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;
}
Per i piú smemorati, una lista di comandi principali usati con linux cd : cambia la directory corrente. ls : mostra il…
in:Scripts e tutorials (0 commenti)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)Questo è un widget di jQuery per il nuovo social network di Google-Buzz-che è possibile incorporare ovunque per…
in:Scripts e tutorials (0 commenti)Questo é un pratico codificatore/decodificatore/decriptatore (chiamatelo come volete) di password inserite nei file di configurazione .ste su dreamweaver function…
in:Scripts e tutorials (0 commenti)Il PageRank è un algoritmo che usa Google per valutare la credibilità e l'autorevolezza delle pagine Web. Il…
in:Scripts e tutorials (8 commenti)Con questo script possiamo limitare il download di un file dal nostro server php; il limite di velocitá…
in:Scripts e tutorials (0 commenti)Alcuni host hanno disabilitati nei settaggi del.ini i comandi allow_url_fopen. Questo significa anche non poter usare i vantaggi…
in:Scripts e tutorials (2 commenti)Gli SHORT URLS fanno ormai parte di quelle cose di internet che ci suonono terribilmente familiari; per capirci…
in:Scripts e tutorials (0 commenti)
