php compare string
<?php
$var1 = "Hello";
$var2 = "hello";
if (strcmp($var1, $var2) !== 0) {
echo '$var1 is not equal to $var2 in a case sensitive string comparison';
}
?>
php compare string
<?php
$var1 = "Hello";
$var2 = "hello";
if (strcmp($var1, $var2) !== 0) {
echo '$var1 is not equal to $var2 in a case sensitive string comparison';
}
?>
php obscure string
/**
* @param string|string[] $plain
* @param int $revealStart
* @param int $revealEnd
* @param string $obscuration
* @return string|string[]
*/
function obscure(
$plain,
int $revealStart = 1,
int $revealEnd = 0,
string $obscuration = '*'
) {
if (is_array($plain)) {
return array_map(
function ($plainPart) use ($revealStart, $revealEnd, $obscuration) {
return obscure($plainPart, $revealStart, $revealEnd, $obscuration);
},
$plain
);
}
$plain = (string) $plain;
return mb_substr($plain, 0, $revealStart)
. str_repeat(
$obscuration,
max(
0,
mb_strlen($plain) -
($revealStart + $revealEnd)
)
)
. mb_substr(
$plain,
-$revealEnd,
$revealEnd
);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us