-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
actually that rule about urgency is dated. We actually promote the opposite. If your post is urgent, we'll get right on it. Yep, we sure will. In fact, the more times you mention it's urgent, the more we will escalate it. Mark it as high priority in the queue, etc... but I'm just not feelin' it. Sure, he put it in the subject, but it's not in caps, and he could have put it 2 or 3 times in the subject. With stars or something. And in his post, I only see 'urgent' twice. To me, that doesn't seem all that urgent. Sorry OP, I'm just not buying it. If it was really urgent I woulda seen it after every line break.
-
and by 'might' he means 'will'.
-
Or perhaps you know, you should explicitly declare class properties before using them. yeah...that's what I usually do...hence having never done that before and therefore didn't know you could
-
European Commision objects Oracle's take over for sun
.josh replied to nrg_alpha's topic in Miscellaneous
IMO average joe doesn't really give a shit about "database competitiveness"; just worried about what Oracle is gonna do with mysql, be it charging for it or discontinuing it. -
well i knew it didn't have anything to do with the referencing. I was thinking more along the lines of it creating it simply because you assign something to it in general (like in your example). I didn't know you could do that. I've never done that before...never really had a need to...
-
[SOLVED] URL Variable Problems from Redirect Page
.josh replied to BoarderLine's topic in PHP Coding Help
it's the htmlspecialchars that is doing it. It converts special chars (like that &) to their html entity. You have it wrapped around $string in your return. -
$this->db is shorthand for a property in the class. So somewhere in the class (probably at the top) you would have: class someClass { // example: private $db = ''; // that $this->db in the function (method) below points to this $db right here function someClass(&$db) { $this->db = &$db; } edit: er..I guess I failed to notice you mentioned it not being present... maybe it's declared somewhere below? Maybe you can declare it like that...if you can, I guess I'll learn something new here too... edit2: ...and I just tested, and apparently you can.
-
[SOLVED] Combining "print strip_tags" and "print string_limit_words"
.josh replied to Olivier's topic in PHP Coding Help
assuming get_the_excerpt() returns a string containing whatever, and assuming string_limit_words() returns that string truncated to 35 chars... <?php print strip_tags(string_limit_words(get_the_excerpt(),35)); ?> -
problem with assigning sql result to php variable
.josh replied to want2php's topic in PHP Coding Help
If I'm understanding you correctly, you could just use a multi-dim array: // use _assoc instead of _array because _array returns both numerical and associative index and you don't need both while ($row = mysql_fetch_assoc($result)) { $count_stat[$row['user_id']][$row['cur_stat']] = $row['cur_stat']; } // example to see structure: echo "<pre>";print_r($count_stat); -
How do i amend a line in a delimited text file using php?
.josh replied to davocold's topic in PHP Coding Help
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. -
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"
-
took me a min... I was about to vote for suggesting he trim $email then at last second noticed.
-
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.
-
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.
-
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.
-
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)
-
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.
-
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
-
PHP error handling to limit characters in textarea.
.josh replied to codeboy89's topic in PHP Coding Help
if (strlen($string) > 3000) { // longer than 3000 } -
$raw = preg_replace('~href\s?=\s?"((?!https?://)[^"]*)"~i','href="http://www.domain.com/$1"',$raw);
-
yeah...every time you ask for suggestions you throw a fit when you get them.
-
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...
-
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.