Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
177 views
in Technique[技术] by (71.8m points)

php - The value in the array?

I want to retrieve or check whether the "ket_upload" key contains "cash" or "credit" values. Do you have any suggestions?

The data is like this :

Array (
    [0] => Array (
        [kd_upber] => 54 
        [kd_p] => 35 
        [kd_r] => 16 
        [harga] => 128000000 
        [type] => 64 Plus 
        [lokasi] => Ds. PENTADIO BARAT, KEC. TELAGA BIRU 
        [blok] => D 
        [no_rumah] => 1 
        [ket_upload] => credit 
        [ktp] => NULL 
        [npwp] => NULL 
        [kk] => NULL
        [skbm] => NULL 
        [buku_nikah] => NULL 
        [kpr] => NULL 
        [tanggal] => 2020-12-31 : 08:19:39
    ) 
    [1] => Array ( 
        [kd_upber] => 55 
        [kd_p] => 35 
        [kd_r] => 17 
        [harga] => 150000000 
        [type] => 64 Plus 
        [lokasi] => Ds. PENTADIO BARAT, KEC. TELAGA BIRU 
        [blok] => E 
        [no_rumah] => 1 
        [ket_upload] => cash 
        [ktp] => NULL 
        [npwp] => NULL 
        [kk] => NULL 
        [skbm] => NULL 
        [buku_nikah] => NULL 
        [kpr] => NULL 
        [tanggal] => 2020-12-31 : 08:21:47 
    )
)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just a suggestion maybe can try this too

foreach($array as $row){
  if($row['ket_upload'] == 'credit' || $row['ket_upload'] == 'cash'){
     #code ...
  }
}

Hope it help ya! also please let me know if there is any error or wrong with my code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share

1.2m questions

2.1m answers

5 comments

56.5k users

...