09.01.2016, 16:09
Hello there, I'm actually a starter on PHP. today I want to make a RP name checker for my UCP registration. I tried like 2 hours and searching randomly on ****** I can't find the shit.. Who can give me a help? and make a function for me?
I made a function but It does not working!!
I made a function but It does not working!!
PHP код:
function IsValidRPName($string)
{
if( stristr( $string , '_' ) )
$_explodedName = explode( "_" , $string );
else return false;
for ($i = 0; $i < $firstName; $i++)
{
if( !ctype_upper ( $_explodedName[ 0 ][ 0 ] ) )
return false;
else if( !$i )
continue;
else if( ctype_upper( $_explodedName[ 0 ][ $i ] ) )
return false;
}
for ($i = 0; $i < $lastName; $i++)
{
if(!ctype_upper($_explodedName[ 1 ][ 0 ] ) )
return false;
else if( !$i )
continue;
else if( ctype_upper( $_explodedName[ 1 ][ $i ] ) )
return false;
}
if( count( $_explodedName ) < 2 || strlen( $Name[ 0 ] ) < 1 || strlen($_explodedName[ 1 ]) < 1 || strlen( $string ) >= 25 )
return false;
else
return true;
}