Kamis, 25 Juli 2013

PHP Indonesia - Facebook: Tanya soal preg_replace: Ada $nama= Mean | Define ...

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. NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Tanya soal preg_replace: Ada $nama= Mean | Define ...
Jul 25th 2013, 15:10, by Fi Nofriani

Fi Nofriani 3:10pm Jul 25
Tanya soal preg_replace:
Ada $nama= Mean | Define Mean at Dictionary.com
Saya mau menghapus tanda "|"

Kalau begini: $nama2 = preg_replace('/ | /', '', $nama); hasilnya "Mean|DefineMeanatDictionary.com"
Kalau begini: $nama2 = preg_replace('/|/', '', $nama); hasilnya tidak berubah
Kalau begini $nama2 = preg_replace('|', '', $nama); munculnya "no delimiter"

Apa yang benar caranya? Makasih..

Anton Wahyu Pramono 3:11pm Jul 25
saya biasa pakai str_replace("|","",$nama);

Fi Nofriani 3:19pm Jul 25
Oh.. Makasih..
Terus kalau misalnya mau ngapus ', :, itu tinggal ditambah aja? Dipisah dng spasi atau tidak?

Anton Wahyu Pramono 3:21pm Jul 25
pakai parameter array contohnya str_replace(array("|","', :,"),array("","",$nama));

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