php replace ****
Moderators: Moderatori ajutatori, Moderatori
- LondoN eXtream
- Membru eXtream
- Posts: 2756
- Joined: 10 Oct 2014, 06:21
- Detinator Steam: Da
- SteamID: /id/london_extreamcs
- Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni) - Fond eXtream: 0
- Location: Roman, Neamț
- Has thanked: 3 times
- Been thanked: 13 times
Deci eu din database preiau un ip de forma 123.123.123.123 si as vrea ca atunci cand il afisez in pagina sa transforme ip=ul in 123.123.***.***, ceva idei, tutoriale, sau macar cum fac asa ceva?
-
- Membru, skill 0
- Posts: 54
- Joined: 13 Nov 2018, 11:24
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
- Contact:
Code: Select all
function MyDadAbusedMe ( $param ) {
$ip_items = explode('.', $param);
$filtered_ip = '';
foreach($ip_items as $item) {
if($item == end($ip_items)) {
$ip_part = '***';
} else {
$ip_part = $item . '.';
}
$filtered_ip .= $ip_part;
}
return $filtered_ip;
}
- LondoN eXtream
- Membru eXtream
- Posts: 2756
- Joined: 10 Oct 2014, 06:21
- Detinator Steam: Da
- SteamID: /id/london_extreamcs
- Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni) - Fond eXtream: 0
- Location: Roman, Neamț
- Has thanked: 3 times
- Been thanked: 13 times
Code: Select all
$myIP = "127.0.0.1";
$ipOctets = explode('.', $myIP);
$newIp = $ipOctets[0] . '.' . $ipOctets[1] . '.' . preg_replace('/./', '*', $ipOctets[4]) . '.' . preg_replace('/./', '*', $ipOctets[3]);
- AGSQ
- Membru, skill +2
- Posts: 778
- Joined: 29 Dec 2014, 23:53
- Detinator Steam: Da
- Fond eXtream: 0
- Has thanked: 14 times
- Been thanked: 2 times
- Contact:
O poti face mult mai simplu, daca e o valoare constanta.
$str="123.123.123.143"
$str=str_replace("143", "valoare_noua", $str);
$str="123.123.123.143"
$str=str_replace("143", "valoare_noua", $str);
Web Hosting gratuit cu SSL inclus si Litespeed pentru orice site care tine link in footer. PM daca te intereseaza.
VPS SSD Ieftin IPv6-Only, in Europa, la doar 0.8€/luna!
VPS SSD Ieftin IPv6-Only, in Europa, la doar 0.8€/luna!
- fan_haulin
- Fost moderator
- Posts: 2592
- Joined: 08 Jun 2010, 20:35
- Detinator Steam: Da
- Reputatie: Fost Moderator
- Has thanked: 271 times
- Been thanked: 106 times
- Contact:
$ipAddress = '127.0.0.1';
Eu iti recomand si o validare de IP.
function ipAddressMask(string $ipAddress) {
if(filter_var($ipAddress , FILTER_VALIDATE_IP)){
$data = explode('.', $ipAddress);
return $data[0].'.'.$data[1].'.xxx.xxx';
}
return null;
}
Eu iti recomand si o validare de IP.
function ipAddressMask(string $ipAddress) {
if(filter_var($ipAddress , FILTER_VALIDATE_IP)){
$data = explode('.', $ipAddress);
return $data[0].'.'.$data[1].'.xxx.xxx';
}
return null;
}
-
- Utilizator neserios
- Posts: 847
- Joined: 02 Nov 2014, 18:21
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Reputatie: Fost Scripter eXtreamCS
Utilizator neserios - Fond eXtream: 0
- Location: Constanta
- Has thanked: 40 times
- Been thanked: 30 times
https://stackoverflow.com/questions/135 ... eplacement
https://stackoverflow.com/questions/487 ... eg-replace
https://stackoverflow.com/questions/819 ... p-with-php
e greu sa dam un search pe google, hai sa facem post pe extreamcs unde nici nu are treaba ceea ce ai postat tu cu forumul
https://stackoverflow.com/questions/487 ... eg-replace
https://stackoverflow.com/questions/819 ... p-with-php
e greu sa dam un search pe google, hai sa facem post pe extreamcs unde nici nu are treaba ceea ce ai postat tu cu forumul
https://discord.gg/VABVdhXMrK ZM CSO server in working..
- Iluminatii
- Membru, skill +4
- Posts: 1539
- Joined: 31 Mar 2014, 02:52
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Reputatie: Fost Membru Club eXtreamCS ( o luna )
- Has thanked: 13 times
- Been thanked: 13 times
- Contact:
Diversity wrote:https://stackoverflow.com/questions/135 ... eplacement
https://stackoverflow.com/questions/487 ... eg-replace
https://stackoverflow.com/questions/819 ... p-with-php
e greu sa dam un search pe google, hai sa facem post pe extreamcs unde nici nu are treaba ceea ce ai postat tu cu forumul
Code: Select all
Discutii despre tot ce nu se incadreaza in celelalte categorii.
Copiii cu nevoi speciale nu sunt ciudati sau neobisnuiti. Ei vor ceea ce toata lumea vrea; sa fie acceptati, sa fie iubiti.
-
- Information
-
Who is online
Users browsing this forum: Bing [Bot], eternity, MDFK. eXtream and 369 guests