Advertisement
touhid_xml

Data Zoom

Aug 26th, 2015
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $product = new stdClass();
  3. $product->image = "test.jpg";
  4. $product->name ="Test Product";
  5. $attr = array(
  6.     'src' => 'images/men/' . $product->image,
  7.     'class' => 'thumb',
  8.     'data-cloudzoom' => 'zoomImage: images/men/large/' . $product->image,
  9.     // Alternative normal css is like : data-cloudzoom = "zoomImage: 'images/large/$product->image'"
  10.  
  11.     'alt' => $product->name
  12. );
  13.  
  14. $html = "<img ";
  15.  
  16. foreach($attr as $key => $value){
  17.     $html .= "{$key}=\"{$value}\" ";
  18.  
  19. }
  20.  
  21. $html .= " />";
  22.  
  23. echo $html;
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement