maxudaskin Posted June 23, 2008 Share Posted June 23, 2008 I wrote this, but it won't seem to work for me. I want to (let * be a variable) take the first variable from code one and put them into another array. There may be multiple instances that I want to take (lets say each line has a different variable that I want to take). [" * "]*²[/" * "] [" * "]*²[/" * "] [" * "]*²[/" * "] I got this, but it gives me an error. <?php /*******************************************/ /* */ /* Written by Max Udaskin */ /* */ /* [email protected] */ /* */ /*******************************************/ /* */ /* No part of this script may be used */ /* without written consent of the original */ /* author himself and nobody else. */ /* */ /*******************************************/ // Open, Read and Close the file $file = fopen("constants.txt","r"); $contents = fread($file,filesize("constants.txt")); fclose($file); // Set Variables $varnames = preg_replace("/\[(.+?)\]/*\[/(.+?)]/","$1\n",$output); echo $output; ?> Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/.grable/vzoom/virtualzoom.net/email/emailer.php on line 22 Link to comment https://forums.phpfreaks.com/topic/111431-solved-another-preg_replace-question/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.