Jump to content

thechad

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thechad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks, that should do it.... Although I replaced with a space, and then the next line I replace spaces with a 0.... I want to know where the other characters were, I just want to replace them with a 0 Thanks again.
  2. Thanks, I made that change, and I understand you're exactly right. Now is there a way I can parse through the string and remove any characters that are NOT alpha/numeric? I've using this value to pass a variable in the hyperlink, and if any characters other than letters or numbers appear, the whole string is simply ignored.
  3. <a href="delete.php?rid=<?php echo $indexnumber ?>&hihi=<?php echo $hihi ?>">sent</s> that would pass rid and hihi to the delete.php page. (make sure
  4. I've tried to handle this a few ways, and none of them seem to work. Warning: preg_replace() [function.preg-replace]: Empty regular expression in /home/content/index.php on line 32 $_SESSION['keywords'] = get_search_phrase($_SERVER["HTTP_REFERER"]); $key = $_SESSION['keywords']; if (empty($key)) { $key = "nokeywords"; } $words = preg_replace(" ", "0", $key); //replace any spaces with "0". Now I've also tried it this way.... $_SESSION['keywords'] = get_search_phrase($_SERVER["HTTP_REFERER"]); $key = $_SESSION['keywords']; if ($key == "") { $key = "nokeywords"; } elseif ($key == NULL) { $key = "nullkeywords"; } $words = preg_replace(" ", "0", $key); //replace any spaces with "0". Neither one worked... Maybe there's an easier way to do it? What I'm actually trying to accomplish is to strip out ANY character in the variable that is not alpha/numeric. I only want numbers and letters in the strings. I know I'm only currently going after spaces, but maybe there's an easier function to accomplish this that I'm unaware of. Thanks for your input in advance.
×
×
  • 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.