-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
there's no such thing as an 'e' modifier. I assume maybe you meant 'i' except that you already cover capital and lower case in your char class so really, I have no idea what you intended to do with that 'e'
-
PHP Error fopen Issue Webmaster Says Its Not A Problem
.josh replied to newbie_101's topic in PHP Coding Help
that error means that common.php is trying to use the fopen function to open a file that doesn't exist. -
okay redarrow, but if you strtoupper then you won't preserve the case of the rest of the string.
-
Yes preg_replace is enabled by default. Don't use eregi_replace or any posix functions (ereg_xxx) as they are not going to be part of the core as of php6. Why? Because they are stupid and inferior.
-
could use preg_replace.
-
How can I get people to resell my hosted software product?
.josh replied to tibberous's topic in Miscellaneous
Sounds like a pyramid scheme... -
ctrl+alt+s does whatever the program wants it to do. It's not exactly a standard, though people do generally try to informally keep certain things standard. It would help if you told us what program (and version) and what OS you are using.
-
All I really care about in an editor is that it has some kind of remote file opening/saving functionality. I like syntax highlighting and code block collapsibility, but I can live without them. Tabbed multiple files is also nice, but not necessary. I use html-kit. It doesn't have code block collapsing (I think the paid version does), and it doesn't have tab multiple files. Dreamweaver has all of the above, but I don't really care for their code block collapsing. Doesn't quite work the way I wish it would. Also, dreamweaver itself is way too bloated for me. Too much stuff I never use. I'm sure it's great for some people, but I personally don't care to pay a bunch of money for for a glorified text editor/ftp program.
-
A regex could be made to extract that data, but it may or may not work within the larger context of where that posted content is.
-
well since it's it's sorted, they are grouped together in the sorted list. All you would need to do is throw in a simple condition to see when the weight and height changes. Start a new table in your loop when it happens, or however you want it to display.
-
umm...you would use html to embed a flash object? Wait, is this a trick question?
-
If you had said that's what you wanted in the first place, all you have to do is put everything into an array and sort by weight, then height.
-
well if you're trying to figure out which pixels are black and which ones are white, then coincidentally, the condition in that post will actually be of some use to you.
-
Depending on the situation, I'll either use heredoc or escape out of the php tags and just do individual php tags when necessary. He just asked if it was possible so I addressed that specifically.
-
Well what are you expecting, a tutorial on how to pick a specific pixel row in an image file, and loop to the end of it? I doubt you're going to find a tutorial that specific. The post I pointed you to does exactly what you want, only more. It just loops through all of the rows and does some condition the other guy needs, that has nothing to do with what you want. As said, all you need to do is remove the outer for loop and use the specific row number you want, and cut out the condition, since you don't need it. I don't think it will get any more specific for you. There is plenty of comments in the code, and you can also go to the manual and look at each of those GD functions to read up on what all they actually do. You said you don't want to sound ungrateful, but I mean come on, I'm handing something to you on a silver platter. What more do you want?
-
yes, you can do that. But since you use " ... " to encapsulate your string, you need to escape all occurrences of " inside your string, like this: \" so that php knows that you aren't trying to close your string quotes.
-
look at this post. All you have to do is strip out the outer loop and conditions and stuff.
-
well damn...upon further inspection, I was wrong even about double negative. Apparently 2 wrongs do make a right. It does search until it finds a match. So if you match return !preg_match('#[^A-Za-z]#', $string); against asdf 2asdf sdf2 2323 you will get false true true true from the negated class, but the ! will invert it. Okay my bad, it does work. But still, you don't need to make it so complicated, lol. As far as mine returning a true on a new line: $string = "test\n@"; if (preg_match('~^[A-Za-z]+$~', $string)) echo "$string true"; else echo "$string false"; echo "<br/>"; if (preg_match('~^[A-Za-z0-9]+$~', $string)) echo "$string true"; else echo "$string false"; output:
-
If that is the only thing in your string (not some number in a larger string), then you can do this: $string = 'HD1234'; if (preg_match('~^HD[0-9]+$~',$string)) { // matches, do something }
-
whoa there buddy, step away from the regex. There's no reason to be doing double negatives like that. ^ inside a character class will only match something that is not listed, so you're having to turn around and use ! to do the opposite of that negative. Also, you're only checking for 1 character. The first character. So if a string is '1abc' it will return positive for numeric. You need to add a quantifier and start and end of string assertion. if preg_match('~^[A-Za-z]+$~', $string) // is alpha if preg_match('~^[A-Za-z0-9]+$~', $string) // is alphanumeric you could also use ctype_digit ctype_alnum ctype_alpha
-
really. What is the difference between doing that and just using $_POST?
-
well if you're not going to validate them, then why not just do extract?
-
be more specific. Are you meaning to say that sometimes the string might be 1234 and sometimes it might be HD1234 and you only want to do something if it's HD1234?
-
well seeing as how his code doesn't use | anywhere...kind of hard to be exploding by that...
-
remove the order by ... from both parts of your code and concat it to your query after the condition.