[PHP]特定の文字が含まれているのか
特定の文字が含まれているのか
if (strpos($url,'?')===FALSE ) { echo '?が入ってない'; }else{ echo '?が入ってる'; }
特定の文字が含まれているのか
if (strpos($url,'?')===FALSE ) { echo '?が入ってない'; }else{ echo '?が入ってる'; }
formでファイルをアップロードするときのファイルサイズの設定は2ヶ所
・upload_max_filesize
・post_max_size
upload_max_filesizeの値以上の容量のファイルをアップするとエラーになる。
post_max_sizeの値以上の容量のファイルをアップすると、おかしな動きをしてエラーを検知出来ない。
参考
PHP: エラーメッセージの説明 – Manual
http://php.net/manual/ja/features.file-upload.errors.php
rootのUIViewControllerを入れ替える
UIViewController*newvc=[[UIViewController alloc]init]; [UIApplication sharedApplication].keyWindow.rootViewController=newvc;
xibからUIView生成
NSArray*objects=[[NSBundle mainBundle] loadNibNamed:@"NibName" owner:self options: nil]; UIView*view=[objects objectAtIndex: 0];
UILabelの文字間を設定
-(void)setLetterSpacing:(UILabel*)label letterSpacing:(float)letterSpacing{ NSMutableAttributedString* attributedText= [[NSMutableAttributedString alloc] initWithString:label.text]; [attributedText addAttribute:NSKernAttributeName value:[NSNumber numberWithFloat:letterSpacing] range:NSMakeRange(0, attributedText.length)]; label.attributedText = attributedText; }
UILabelの行間を設定
-(void)setLineHeight:(UILabel*)label lineHeight:(float)lineHeight{ NSMutableParagraphStyle *paragrahStyle = [[NSMutableParagraphStyle alloc] init]; paragrahStyle.minimumLineHeight = lineHeight; paragrahStyle.maximumLineHeight = lineHeight; NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:label.text]; [attributedText addAttribute:NSParagraphStyleAttributeName value:paragrahStyle range:NSMakeRange(0, attributedText.length)]; label.attributedText = attributedText; }
UIScrollViewがスクロール出来ないときチェックすること
・User Interaction Enabledがチェックされているか(XCode上)
・setContentSizeでサイズ指定しているか(プログラム上)
・Use Autolayoutのチェックが外れているか(XCode上)
NSStringでクラス名を指定する
Class targetClass=NSClassFromString(@"SettingViewController"); UIViewController*currentCV=[[targetClass alloc]init];
AppModel.php
public function isHalfLetter($data) { $str = current($data); return preg_match('/^[\x21-\x7E]*$/', $str); }
各モデル
var $validate=array( 'target'=>array( 'rule1'=>array( 'rule' => 'isHalfLetter', 'message' => '全角文字が含まれてるっす' ), ) );