这是代码:
- (UIImage *)getThumbnailOfSize:(CGSize)size forObject:(UIBezierPath *)object
{
// to maintain the aspect ratio, we need to compute the scale
// factors for x and y, and then use the smaller of the two
CGFloat xscale = size.width / object.bounds.size.width;
CGFloat yscale = size.height / object.bounds.size.height;
CGFloat scale = (xscale < yscale) ? xscale : yscale;
// start a graphics context with the thumbnail size
UIGraphicsBeginImageContext( size );
CGContextRef context = UIGraphicsGetCurrentContext();
// here's where we scale and translate to make the image fit
CGContextScaleCTM( context, scale, scale );
CGContextTranslateCTM( context, -object.bounds.origin.x, -object.bounds.origin.y );
// draw the object and get the resulting image
[object stroke];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
这是检查php
<input type="password" name="pass">
<input type="password" name="npass">
<input type="password" name="npass2">
答案 0 :(得分:1)
请使用以下功能
function checkPasswordStrength($password)
{
if(!preg_match('/[A-Z]/', $password))
return false; // for capital letter
elseif(!preg_match('/[0-9]/', $password))
return false; // for number
elseif(!preg_match("/[a-z]/", $password) )
return false; // for small letter
elseif(!preg_match("/[`!%$&^*()@#]+/", $password))
return false; // for special character
elseif(strlen($password) < 8)
return false; // for password length
else
return true;
}