Jump to content

AbraCadaver

Staff Alumni
  • Content Count

    1,893
  • Joined

  • Last visited

  • Days Won

    8

AbraCadaver last won the day on November 3 2013

AbraCadaver had the most liked content!

Community Reputation

61 Excellent

About AbraCadaver

  • Rank
    Creepy Ass Cracka Memba
  • Birthday 02/20/1971

Contact Methods

  • Website URL
    http://www.spidean.com

Profile Information

  • Gender
    Male
  • Location
    The Republic of Texas

Recent Profile Visitors

23,971 profile views
  1. $confirmation is a string and not an array at that point. If you did $confirmation[0] it would give you string offset 0 which is the first character of the string, but there is no redirect offset in a string.
  2. Another one: if(preg_grep("/$search/i", file("legitimatesites.txt"))) { echo "This website is an authorised distributor"; } elseif(preg_grep("/$search/i", file("illegitimatesites.txt"))) { echo "This website is NOT an authorised distributor"; } else { echo "Unknown website"; }
  3. First, clarify what "but it doesnt seem to work" means. Report any errors using: error_reporting(E_ALL); ini_set('display_errors', '1'); Also, no need to loop, you can use arrays in the str_ireplace: $haystack = file($file); /* put contents into an array */ $search = "$name, $sname"; /* value to be replaced */ $replace ="replaced, replaced"; /* value doing the replacing can be replaced by new variables*/ $haystack = str_ireplace($search, $replace, $haystack); /* case insensitive replacement */ But one problem is, what if $name and $sname are on different lines? No replacement is made. Maybe just use the file as a string: $haystack = file_get_contents($file); /* put contents into a string */ $search = "$name, $sname"; /* value to be replaced */ $replace ="replaced, replaced"; /* value doing the replacing can be replaced by new variables*/ $haystack = str_ireplace($search, $replace, $haystack); /* case insensitive replacement */
  4. = is for assignment. Try using == in the if statements. You could also use: <?php echo $_SESSION['sysadmin'] ? "YES" : "NO"; ?>
  5. I had a better one that used references but this is what I found: function glob_recursive($pattern, $flags = 0) { $files = glob($pattern, $flags); foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); } return $files; }
×
×
  • 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.