Rabu, 11 September 2013

PHP Indonesia - Facebook: Malam mastah,, udah mentok jadi pingin nanya. Cont...

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/ 
Mobile Game Development Course

Learn how to create awesome HTML5 games that run on iPhone, iPad, Android and Desktop! Sign up today for this $99 online course.
From our sponsors
Malam mastah,, udah mentok jadi pingin nanya. Cont...
Sep 11th 2013, 17:38, by Filsafat Musafir Hati

Filsafat Musafir Hati 5:38pm Sep 11
Malam mastah,, udah mentok jadi pingin nanya.
Contoh XML :
-----------------------------------------------------
<data>
<info>
<nama>andi</nama>
<usia>64 tahun</usia>
<pekerjaan>buruh</pekerjaan>
</info>
<info>
<nama>budi</nama>
<usia>32 tahun</usia>
<pekerjaan>tani</pekerjaan>
</info>
<info>
<nama>umar</nama>
<usia>26 tahun</usia>
<pekerjaan>buruh</pekerjaan>
</info>
</data>
----------------------------------------------------------
Ane pingin parsing tapi hanya ingin menampilkan data yang pekerjaan nya "buruh".. Liat di stact overflow semuanya banyak mengacu pada filter via tagname.. jadi filter via "pekerjaan","usia" atau "nama".. Tapi ane pingin filter dari valuenya yang "BURUH" itu.

Jadi pingin outputnya jadi gini
---------------------------
andi 64 tahun buruh
umar 26 tahun buruh
---------------------------
Bisa ngk ya??? :/
Terimakasih sebelumnya

Gunawan Mujur Wibisono 5:39pm Sep 11
saat ini km pake solusi apa.. share scriptnya

Filsafat Musafir Hati 5:47pm Sep 11
<?php
$info = new SimpleXMLElement ('./xml/info.xml', null, true);
foreach ($data->info as $info)
{
if ($info->pekerjaan==tani)
{
echo $info
}
}
-------------------------
hasilnya blank :/

Filsafat Musafir Hati 5:48pm Sep 11
ane bikin if ($info->pekerjaan==buruh)
Hasilnya juga BLANK

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