Sabtu, 16 November 2013

PHP Indonesia - Facebook: (help ask) gan tolong bikinin fungsi cek string ga...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Learn to Play Electric Guitar

Perfect for those new to guitar. Learn to play electric guitar with these easy step-by-step video lessons from JamPlay! Sign up for just $39.
From our sponsors
(help ask) gan tolong bikinin fungsi cek string ga...
Nov 16th 2013, 09:03, by Omarseda

Omarseda 9:03am Nov 16
(help ask)
gan tolong bikinin fungsi cek string gan.. kalo hanya terdiri atas huruf angka spasi dan petik tunggal return true selain karakter2 tadi return false. ane udh ngutakatik dri tdi ga dapet-dapet. tpi jgn pke regex gan.. pake fungsi string biasa..
help ya gan.. thx.

Omarseda 9:05am Nov 16
tambahan : sekalian konversi whitespace jadi spasi biasa dlm string gan.. hehe..

Fajar Khairil Amin 9:06am Nov 16
http://kohanaframework.org/3.3/guide-api/Valid#alpha_numeric

Fajar Khairil Amin 9:07am Nov 16
gw copasin deh :
// Checks whether a string consists of //alphabetical characters and numbers only.
public static function alpha_numeric($str, $utf8 = FALSE)
{
if ($utf8 === TRUE)
{
return (bool) preg_match('/^[\pL\pN]++$/uD', $str);
}
else
{
return ctype_alnum($str);
}
}

Omarseda 9:12am Nov 16
kalo pake ctype_alnum kalo string ada tanda petik atau spasi jadi false gan.. dritadi ane ngutikngutik itu gan.. btw utf8 apa ya gan.. apa semacam karakter huruf non latin?

Fajar Khairil Amin 9:20am Nov 16
nganu kurang tau gan..harus ngarti regex kyaknya di modif dikit bisa deh

Ahmad Sanusi 9:35am Nov 16
nih regex nya ,
^[A-Z0-9 _]*[A-Z0-9][A-Z0-9 _]*$
kalo mau lowecase tinggal :
^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$

bisa di check disini --> http://www.regular-expressions.info/javascriptexample.html

Omarseda 9:39am Nov 16
itu udah huruf, angka, petik tunggal sama spasi normal gan..?

Ahmad Sanusi 9:40am Nov 16
iya, check aja di link,

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar