title: Need PHP to multiple str_replace and jQuery text.replace
body: <p>I have this line of code that will replace special character in php: <br></p>
  
  <pre><code>&lt;?php echo str_replace(" +12,00$,"1200",$this-&gt;htmlEscape($_image-&gt;getLabel())) ?&gt;" /&gt;
  </code></pre>
  
  <p>for this to work as i need, also the jQuery will have to include this code in other call:</p>
  
  <pre><code>jQuery("#productImg" + optionValueText.replace(' +12,00€','1200')).fadeIn('slow');
  </code></pre>
  
  <p>This will outpout <code>1200</code> and it will work good to add a span id for an image to load.
  But i will have multiple prices, so i need automatic to do the work.</p>
  
  <p>I need to make both codes to remove white space in the beggining <code></code> and characters <code>+</code>  <code>,</code> <code>€</code> from the price so allways it will display the price as 1200,4400,3399 etc.
  For php i think i can do it if i play some time with the code but for jQuery line also?</p>
  
  <p>Can somebody provide both codes please?</p>
  
  <p>Thank you very much for your kind help!</p>
  
  <p>EDIT:
  the full php code that will load the image:</p>
  
  <pre><code>&lt;a href="#" onclick="popWin('&lt;?php echo $this-&gt;getGalleryUrl($_image) ?&gt;', 'gallery', 'width=999,height=999,left=666,top=333,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"&gt;
  &lt;span style="margin-top:-212px;"&gt; &lt;img src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($this-&gt;getProduct(), 'image', $_image-&gt;getFile()); ?&gt;" alt="no image" id="productImg&lt;?php echo str_replace(" +12,00€","1200",$this-&gt;htmlEscape($_image-&gt;getLabel())) ?&gt;" /&gt;&lt;/a&gt;&lt;/span&gt;    
  </code></pre>
  
  <p>and the jQuery that on dropdown change will control what image to hide and show.</p>
  
  <pre><code>jQuery(document).ready(function() {
  
  // On document ready hide all images first
  
  jQuery(".product-image2 img").hide();
  jQuery("#off").hide();
  jQuery("#productImgDefault").show();
  
  jQuery("#&lt;?=$colour_select_id ?&gt;").change(function() {
      // Hide all images on slect element change action
       jQuery(".product-image img").hide();
       jQuery(".product-image2 img").hide();
        jQuery("#productImgDefault").hide(); 
           jQuery(".product-image .mousetrap").hide();                        
  
  
      // Get the value of selected option
      var optionValue = jQuery(this).attr('value');
      // Just a test to see if you're getting option value
      // alert(optionValue);
  
      // Get the content (aka inner HTML) of selected option
      var optionValueText = jQuery.trim(jQuery('#&lt;?=$colour_select_id ?&gt; :selected').text());
  
      // Just a test to see if you're getting right selected option inner text
      // alert(optionValueText);
   //  alert('Selected option has value: ' + optionValue + ' and inner text: ' + optionValueText);
  
      // Show the image based on selected value
      // Whatch out, case sensitive...
  
    if(optionValueText == "-- choose --") {
      jQuery(".product-image .mousetrap").show(); 
       jQuery("#on").fadeIn('slow');
        jQuery("#off").hide();
  jQuery("#productImgDefault").fadeIn('slow'); } else { jQuery("#productImg" + optionValueText.replace(' +12,00€','1200')).fadeIn('slow');
    jQuery("#off").fadeIn('slow');
    jQuery("#on").hide();
  }
    });
  
  });
  </code></pre>