Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. a) make sure you are not using 'a' or 'a+' with fopen, because fwriting will always append it to the end of the file, regardless of what you do b) you need to use ftell to get the current location of each line as you fread or fget it c) you need to use fseek to move the pointer to the relevant location in the file before fwriting the line. You would find the beginning of the target line by the previous line's ftell result + the strlen of that previous line d) make sure when fwriting you pad with whitespace the difference in line length or else remove any trailing existing stuff. IOW if what you are changing is shorter than what was there before, you're gonna see that extra stuff still there.
  2. Studies have shown that real regex men use hash instead (and I'm not only refering to delimiters either). ooh I think you finally won me over to using # instead of ~ I can say "I like hash"
  3. took me a min... I was about to vote for suggesting he trim $email then at last second noticed.
  4. not escaping the dot would not break it per se (it wouldn't break it in this instance, anyways). It'll match (most) anything including a literal dot. Danger of not escaping it is that it can match more than a literal dot. anywhoo...your regex is failing because of this: '$email' You have $email wrapped in single quotes which causes ereg to interpret literally. Remove the quotes. Also as cags mentioned, move to preg_match instead of ereg. Only thing you really need to change for that is you need to add delimeters to your regex.
  5. noob
  6. FF is the main browser I use. It is a good browser, with a lot of very nice plug-ins that make my job a lot easier. I rarely use IE except for testing cross browser compatibility, and the web developer tool in IE was a huge blessing. Now if only MS made their compatibility mode do IE6 also (or conversely, take a more active role in enforcing upgrades...), I'd be a happy camper. Since a lot of my job involves having to constantly delete cookies and stuff for QA purposes, I generally use chrome to keep windows open to things I'm logged into so I don't have to keep logging into shit. Off the clock though, I mostly use FF.
  7. The spacing between each letter. A blank space is X pixels wide, depending on the font you are using. The way you did it, it will be a set X pixel space (whatever the width of the space is for your font you are using. With the way I suggested, you can specify how many pixels worth of space are inbetween each letter. You can even use like rand(1,10) or something to make the amount of space between each letter vary.
  8. there's some limitations to the regex i supplied. 1) it assumes your href attrib is wrapped in double quotes. 2) if there are nested double quotes inside it (escaped, like if there's some js in there...) it's gonna break 3) if you have a relative path with a leading / it's going to replace as http://www.site.com//blahblah (which won't actually break the url, but just thought i'd mention it)
  9. yeah, suppose you could do that if you want it to be spaced by a whole blank space. The way I mentioned would allow you to control the spacing by the pixel.
  10. you would basically loop through your script (up to the imagettftext part) doing 1 letter at a time but with an added offset amount to $x in imagettftext
  11. if (strlen($string) > 3000) { // longer than 3000 }
  12. $raw = preg_replace('~href\s?=\s?"((?!https?://)[^"]*)"~i','href="http://www.domain.com/$1"',$raw);
  13. yeah...every time you ask for suggestions you throw a fit when you get them.
  14. that's because your original is javascript which is a clientside language, whereas preg_split is php which is a serverside language. The php equivalent of js's split is explode but clientside and serverside are two different environments...
  15. .josh

    garbage

    lmfao, everything from garbage man, cook, to atm technician and tech support.@32. but i guess that doesnt count. :'( All I'm saying is that your OP screams "I haven't really had to deal with projects/clients asking for really difficult/impossible stuff, done in really difficult/impossible time frames." Times 10 projects/clients at a time... yes.
  16. .josh

    garbage

    yeah...see how far that outlook gets you when (if) you start working in the real world.
  17. for a more accruate translation you would need to add the i modifier.
  18. .josh

    garbage

    I agree. That statement is garbage.
  19. when browsers first started doing the whole tab thing, it took me a while to get into it. I continued to open a new window for a while. I can't really remember why I had misgivings about it, really... there's really no downside to tabs vs. multiple browser instances open, but on the other hand, having multiple browser instances open takes up more memory, and more taskbar real-estate. Eventually I gave it a serious try and it took some getting used to, but it grew on me, and now I'll never go back if I can help it.
  20. no worries. man..just that, in the business world, there's already more than enough non-tech people who assume a tech person can do everything under the sun, that everything is the same thing, etc...so there will be plenty of times where you don't really have a choice, so don't add fuel to the fire man, lol.
  21. can you give an example of the content you're matching?
  22. you would replace $string with whatever variable has your id.
  23. so the ereg version works and you didn't do anything to it to change it except add the delimiters for preg_match?
  24. $string = preg_replace('~[a-z]~i','',$string);
×
×
  • 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.