Jump to content

ghostdog74

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ghostdog74's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i don't understand what you mean by "no matter where it is", but anyhow, here's something non regex , $str = "f=varying-string&killer=lop&you=pop"; $s = explode("&",$str); $tmp=$s[0]; $s[0]=$s[1]; $s[1]=$tmp; print implode("&",$s);
  2. i have not specifically harded any image file type. as you can see, my code searches for "img class" , therefore, if the link is to a png file, it should still grab for you
  3. no need regex. simple split will do $string = "success adding the records in the river table by scvinodkumar today at 6.36 pm by scvinodkumar [[Category:Test]]"; $s = explode("[[Category:Test]]",$string); print $s[0];
  4. $string = '1051 JoZlkA11215'; $s = preg_replace("/[^a-zA-Z]+/","",$string); print $s;
  5. just use normal string functions $url = "http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&friendID=6221"; $page = strip_tags(file_get_contents($url),"<img>"); $p = explode("/>",$page); foreach($p as $k=>$v){ if(strpos($v,"img class=")!==FALSE) { $jpg = explode("src=",$v); $imagelink = preg_replace("/\"/","",$jpg[1]); #remove doublequotes print "imaglink " . $imagelink; $image = file_get_contents($imagelink); $f=fopen("friend.jpg","w"); fwrite($f,$image); fclose($f); } }
  6. $fp = "[Querying whois.arin.net] [Redirected to whois.ripe.net:43] [Querying whois.ripe.net]"; $a = preg_split("/Querying/",$fp); print end($a);
  7. i only looked at his first post. if its not what he wants, then so be it.
  8. $message="my name is @ redarrow"; if ( ctype_alnum ($message) ){ print "$message is alphanumeric\n"; }else{ print "'$message' is not alphanumeric\n"; }
  9. you do not need to start a mail service if all you are doing is sending out mails.
  10. i would advise against using external shell tools like that as it makes your code not portable. whenever and wherever you can, always try to use PHP's mail methods/classes. Here it has example of how to send html email. I am also sure that if you search hard enough you can find lots of examples on the net.
  11. you are about there. but that says match 2 spaces. if there are 2 or more spaces, you can use {2,}
  12. good. the bottom line is, PHP provides you numerous string functions you can use, regex should be the last thing that comes to your mind.
  13. have you read the manual? see ftp_rawlist() function.
  14. replace the newline with space. $a = preg_replace("/\n/"," ",$find); then continue your checking.
  15. how about this, no regex $docName="Ap%praisal Agreement"; $a = explode(" ",$docName); if ( count($a) == 2){ print "ok, space in between\n"; } if ( ctype_alnum ($a[0]) ){ print "$a[0] is alphanumeric\n"; }else{ print "$a[0] is not alphanumeric\n"; } if ( ctype_alnum ($a[1]) ){ print "$a[1] is alphanumeric\n"; }else{ print "$a[1] is not alphanumeric\n"; }
×
×
  • 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.