Minggu, 21 Juli 2013

PHP Indonesia - Facebook: pagi mastah.. mw tanya nih.. saya punya soal !!!...

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/ 
pagi mastah.. mw tanya nih.. saya punya soal !!!...
Jul 21st 2013, 22:17, by Dammar Sagittarius

Dammar Sagittarius 10:17pm Jul 21
pagi mastah..
mw tanya nih..

saya punya soal !!!

$a="saya makan dan minum dan makan lagi";

nah untuk menampilkan jumlah kata "makan" dalam variabel $a. script php.y gmana ya.?

mhon bntwan.y..
tks.

Slamet Aprilianto 10:41pm Jul 21
mungkin gini..
// pecah string jd array per kata
$arr = explode(' ',$a);
// jumlah kt awal
$i = 0;
// untuk setiap nilai pd array, jika 'makan' mk jmlah kata ditambah 1
foreach($a as $value){
if($value == 'makan') $i++;
}
echo 'Jumlah kata "makan" pada $a adaa :'.$i;

Muhammad Taufiq Hidayat 10:46pm Jul 21
cont

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