PHP-Snippets
 php::MySQL (0)
 php::Image (4)
   » Bild - Boxskalierung
   » Hex-Farbcode -> Farb-Array
   » Farb - Aufheller
   » Farb - Abdunkler
 php::Sonstiges (4)
   » Einfache Template-Funktion
   » Simple HTTP-Post Funktion
   » Simple HTTP-Get Funktion
   » zwischen()-Funktion
 php::Spezielles (2)
   » Zeichenvorkommisse prüfen
   » Array mischen (seeded)
Snippet: zwischen()-Funktion

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
<?
// Used to get the part between two strings
function zwischen($x,$y,$str,$trim false)
{
  
$xx explode($x,$str);
  unset(
$xx[0]);
  
$stop false;
  foreach(
$xx as $x)
  {
    if(
$stop != true)
    {
      
$xxx explode($y,$x);
      if(
count($xxx) > 1)
      {
        
$found $xxx[0];
        
$stop true;
      }
    }
  }
  if(
$trim) { $found trim($found); }
  return 
$found;
}
?>