Hi,
I've a value which needs to be trimmed with the letters to the left of it. That is the word "layer" in anything entered say mlayer or m*layer only needs to be present. the letters to the left of layer needs to be trimmed. How do i do this?

Thanks,
Ramki.

    There are several ways of doing this, here is one of them:

    $value = preg_replace('/.*?(layer.*)/', '$1', $value);

      Hey,
      Thanks it worked!
      I've one more question here. Please help. I'm matching a word which contains "+" in it. Like i'm using preg_match to match a word and i need to search even for "+". Here is my preg_match.

      
      elseif(preg_match('/\b(?:[\d\D]+layer\d|ac3|ddp|aac|aacplus|aac\+|dtv|wma)\b/i',$value))
      

      "aac+" needs to be searched. I've escaped it as shown but its not working! Is it correct?

      Thanks,
      Ramki.

        Sorry, but I do not understand what you are trying to match. Perhaps you would like to provide a few examples.

          ok.
          I'm actually trying to get a text box value from another form to the present form. Like below:

          				  <input type=text id=searchbox name=search size=18 align=right> </td>
           				  <td><input type="button" target=menu value="Go" onclick="fifthframe(document.getElementById('searchbox').value)"> </td>
          
          

          The fifthframe function is a javascript func as below:

          function fifthframe(search)
          		{
          			if(search=="users")
          			{
          				parent.top.location.href="index.html"
          				parent.menu.location.href="menu.html"				
          			}
          			parent.main.location.href="search_home.php?search="+search
          		}
          
          

          But when i try to access this text box value in the present php page, if its given as "aac+" or "ac3+" in the text box, i'm able to access only "aac" or "ac3", the "+" symbol is trimmed off! How do i transfer this "+" from one form to another? Please help.

          Thanks,
          Ramki.

            8 days later

            You need to use JavaScript's escape() function, because in URLs, "+" is used to represent a space.

              Write a Reply...