Jump to content

something fun


kellz

Recommended Posts

well, kinda.. fun^^

 

ok so! i have my little script here:

<?php $k='h'; $l=/*[Kelsey]*/'o';$e='f';$s='p';$y

='z'; $w=$k.$e.$l/*[Kelsey]*/.$s.$e.$y;$d ='';for

($i=0; $i<strlen(/*[Kelsey]*/$w);$i++){$d.=chr(ord

($w[$i])^3);$i++;/*[Kelsey]*/$i=$i-1;}print($d);?>

 

just prints out my name "kelsey" but if i use regex how could i search the code for semi colons and "(" characters and then insert "/*[Kelsey]*/" between them? o and how could i do the same thing but remove "/*[Kelsey]*/" instead? i can do it without regex but i guess it would be alot smaller code if i just used regex!

 

thx!

x

Link to comment
Share on other sites

ok nvm i did it^^ I started to learn regex for the past hour or so, it's kinda not so hard.. here is my solution:

 

to remove any comments between code lines:

echo preg_replace("/(\\/)(\\*).*?[a-z].*?(\\*)(\\/)/",  "", $code);

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.