Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. /* INSIDE THE ARRAY $currencies
  3. array (size=3)
  4.   'currency' => string 'AUD' (length=3)
  5.   'photo_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/AUD-Photo-Price.jpg' (length=67)
  6.   'video_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/AUD-Video-Price.jpg' (length=67)
  7. array (size=3)
  8.   'currency' => string 'CAD' (length=3)
  9.   'photo_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/CAD-Photo-Price.jpg' (length=67)
  10.   'video_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/CAD-Video-Price.jpg' (length=67)
  11. array (size=3)
  12.   'currency' => string 'GB' (length=2)
  13.   'photo_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/GBP-Photo-Price.jpg' (length=67)
  14.   'video_pricing' => string 'http://localhost/ods/wp-content/uploads/2019/12/GBP-Video-Price.jpg' (length=67)
  15.   */
  16. ?>
  17. <?php
  18.     $result = [];  
  19.     foreach($currencies as $currency){
  20.         //my condition
  21.         if(in_array( 'CAD' , $currency )){
  22.             echo $currency['photo_pricing'];//this image must be the image under CAD
  23.             echo $currency['video_pricing'];//this image must be the image under CAD
  24.             break;
  25.         }
  26.     }
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement