Jump to content

roydukkey

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by roydukkey

  1. What is the difference between the two? Tried for hours to fix this and don't know exactly the reasons it works. preg_replace("/\$inc\s+\(([^\)]+)\)/im", $replace, $subject); // Breaks - single quotes preg_replace('/\$inc\s+\(([^\)]+)\)/im', $replace, $subject); // Works - double quotes
  2. Though these suggestions are good, there not quite what I need. I need to retain all the input data, comments and everything else. And, then I did you process each match and place it back exactly where it came from, hence the preg_replace_callback.
  3. Ok, I need more help. Hopefully someone understands this. This following code us sucessful, however I need it to do more. It currently finds '$inc (<<path>>)' and returns '<<path>>'. I need the script to disregard the current match when it is between '/*' and '*/'. Thanks you anyone willing to help. $output = preg_replace_callback('/\$inc\\s*\(([^\)]+)\)/is', create_function( '$match', 'global $domain; array_push( $includedFiles, $match[1]); return trim(file_get_contents( $domain.$match[1] ));' ), $output );
  4. Thanks all for you posts. thebadbad had the answer i was looking for thanks!
  5. Here is the what i need to happen. Much thanks to anyone willing to help. I need to replace 'f=varying-string' from 'f=varying-string&killer=lop&you=pop'. The string need to be replaced no matter where it is. ie. 'killer=lop&f=varying-string&you=pop' I'm trying this: preg_replace( "/^[f=].*(^&.*$)$/is", "", $_SERVER['QUERY_STRING'] );
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.