Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For Share The Logic [Array On PHP]
#6
update lagi nih, untuk ngambilin key/value array yg lebih dari 1 karakter!
Code:
<?php $array = array("mac-132,b-23,c-323","x-4,y-599,z-6"); $imp = implode(",", $array); $exp = explode(",", $imp); for($i=0; $i<count($exp); $i++){ $key[] = substr($exp[$i], 0, (strpos($exp[$i], "-"))); $value[] = substr($exp[$i], (strpos($exp[$i], "-")+1), (strlen($exp[$i]))); $combine = array_combine($key, $value); } print_r($combine); ?>
yah.. :)
Reply


Messages In This Thread
RE: For Share The Logic [Array On PHP] - by cyzee - 02-21-2013, 01:15 PM
RE: For Share The Logic [Array On PHP] - by 777r - 02-21-2013, 03:50 PM
RE: For Share The Logic [Array On PHP] - by g32x_ky.bat - 02-22-2013, 01:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SHARE] Tempat Upload Tool , Jalankan Script dll vba 14 411 08-10-2014, 05:20 AM
Last Post: positive
  [SHARE] Aplikasi Perpustakaan (DIGILIB) untuk sekolah herubrondong 12 272 10-24-2013, 06:30 PM
Last Post: herubrondong
  [Share] Script PHP Web Proxy Untuk Web Hosting CopSLacS 9 222 09-24-2013, 10:36 AM
Last Post: CopSLacS
  (share) w3school ofline devero 9 319 09-16-2012, 04:21 PM
Last Post: hogyz
  [Share] Vbulletin 4.0.3 Freemium Pro-gress 3 91 08-12-2012, 08:18 PM
Last Post: HeriNHT
Lucky_seven_16 Share Your Tips Blog Here Up_ 34 838 11-15-2011, 04:16 PM
Last Post: Aris Devilz
  [Share] Simple Make WAP Site Up_ 12 291 08-19-2011, 10:27 PM
Last Post: aandoni
  [Share] Java Script Buat HN Warna Warni Putrii 13 300 10-21-2010, 11:18 PM
Last Post: topenghitam
  [share] Menghapus komentar spam yang memenuhi blog wordpress Wayc0de 3 64 09-30-2010, 06:39 PM
Last Post: :teroris maentenance:
  [share] Turitorial HTML,MsqL,Php.. Mrz-zgL 7 206 05-08-2010, 12:34 AM
Last Post: Mrz-zgL

Forum Jump:


Users browsing this thread: 2 Guest(s)