Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $product = new stdClass();
- $product->image = "test.jpg";
- $product->name ="Test Product";
- $attr = array(
- 'src' => 'images/men/' . $product->image,
- 'class' => 'thumb',
- 'data-cloudzoom' => 'zoomImage: images/men/large/' . $product->image,
- // Alternative normal css is like : data-cloudzoom = "zoomImage: 'images/large/$product->image'"
- 'alt' => $product->name
- );
- $html = "<img ";
- foreach($attr as $key => $value){
- $html .= "{$key}=\"{$value}\" ";
- }
- $html .= " />";
- echo $html;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement