Breezah gen. dmw preg_replace
Ik dacht voor de grap ff een breezah generator te maken. Maar het werkt niet helemaal.
k heb het volgende:
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('/ª/','/ß/','/ç/','/Ð/','/ê/','/F/','/G/','/H/','/ï/','/J/','/K/','/£/','/M/','/ñ/','/ø/','/þ/','/Q/','/®/','/§/','/T/','/µ/','/V/','/W/','/×/','/ÿ/','/Z/');
$text = preg_replace($arr,$rep,$text);
return $text;
} ?>
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('/ª/','/ß/','/ç/','/Ð/','/ê/','/F/','/G/','/H/','/ï/','/J/','/K/','/£/','/M/','/ñ/','/ø/','/þ/','/Q/','/®/','/§/','/T/','/µ/','/V/','/W/','/×/','/ÿ/','/Z/');
$text = preg_replace($arr,$rep,$text);
return $text;
} ?>
en tjah, het werkt niet.
Het volgende had ik ook al bedacht maar schijnt ook niet te werken:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($arr[$i],$rep[$i],$text);
}
return $text;
} ?>
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($arr[$i],$rep[$i],$text);
}
return $text;
} ?>
Iemand nog andere idee-en?
Mvg Sickness
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($arr[$i],$rep[$i],$text);
}
return $text;
} ?>
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($arr[$i],$rep[$i],$text);
}
return $text;
} ?>
moet zijn
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($rep[$i],$arr[$i],$text);
}
return $text;
} ?>
function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
for($i = 0;$i < count($arr); $i++)
{
$text = str_replace($rep[$i],$arr[$i],$text);
}
return $text;
} ?>
de functie str_replace() wil eerst iets weten waar hij naar moet zoeken en daarna pas wat je inplaats daar van moet zetten daarna in welke string hij moet zoeken. maar voor de rest wel een grappig scriptje:P
greetz serpent
edit: te laat!
Gewijzigd op 21/09/2004 22:54:00 door SerpenT
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?
function breezer($text) {
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
$text = str_replace($rep, $arr, $text);
return $text;
}
?>
function breezer($text) {
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
$text = str_replace($rep, $arr, $text);
return $text;
}
?>
Is al voldoende..
Anders moet je precies de juiste caracter coding doorgeven.
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<? function breezer($text)
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
$text = htmlentities(str_replace($rep,$arr,$text));
return $text;
} ?>
{
$rep = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$arr = array('ª','ß','ç','Ð','ê','F','G','H','ï','J','K','£','M','ñ','ø','þ','Q','®','§','T','µ','V','W','×','ÿ','Z');
$text = htmlentities(str_replace($rep,$arr,$text));
return $text;
} ?>
En dat probeer ik aan te roepen dmv
Code (php)
1
2
3
2
3
<?
$profiel = preg_replace("#\[breezer\](.*?)\[/breezer\]#si", breezer('\\1'), $profiel);
?>
$profiel = preg_replace("#\[breezer\](.*?)\[/breezer\]#si", breezer('\\1'), $profiel);
?>
Iemand enig idee hoe dat op te lossen?
Als ik het test met [breezer]text[/breezer] dan haalt ie wel netjes de tags weg. Maar gaat niet de text bewerken.
@Bas: Sorry van je mooie layout ;)
Mvg Sickness
Gewijzigd op 22/09/2004 10:20:00 door Ano Niem
Niemand die de preg_replace() in orde kan maken?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
function breezer($text) {
$rep = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
$arr = array('ª', 'ß', 'ç', 'Ð', 'ê', 'F', 'G', 'H', 'ï', 'J', 'K', '£', 'M', 'ñ', 'ø', 'þ', 'Q', '®', '§', 'T', 'µ', 'V', 'W', '×', 'ÿ', 'Z');
$text = htmlentities(str_replace($rep, $arr, $text));
return $text;
}
$profiel = 'lalalaaaaaaaaaaaaaaaaaaa[breezer]heeee[/breezer]hooooooo';
$profiel = preg_replace("/\[breezer\](.+?)\[\/breezer\]/ie", 'breezer("\1")', $profiel);
echo $profiel;
?>
function breezer($text) {
$rep = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
$arr = array('ª', 'ß', 'ç', 'Ð', 'ê', 'F', 'G', 'H', 'ï', 'J', 'K', '£', 'M', 'ñ', 'ø', 'þ', 'Q', '®', '§', 'T', 'µ', 'V', 'W', '×', 'ÿ', 'Z');
$text = htmlentities(str_replace($rep, $arr, $text));
return $text;
}
$profiel = 'lalalaaaaaaaaaaaaaaaaaaa[breezer]heeee[/breezer]hooooooo';
$profiel = preg_replace("/\[breezer\](.+?)\[\/breezer\]/ie", 'breezer("\1")', $profiel);
echo $profiel;
?>
Mvg Sickness