Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. post relevant code please. Not gonna sort through your entire file.
  2. Don't pay attention to thorpe's code. It's totally wrong and fails to deliver. he forgot to echo $word; //
  3. Well I don't know. You didn't post the relevant code. You are using a 3rd party script. The relevant code would be inside one of these files: include ("jpgraph.php" ); include ("jpgraph_pie.php"); Your last line there is $graph->Stroke(); so I would start by looking for the Stroke() method in one of those files. Please do not post the files. We aren't here to trudge through 3rd party scripts for people. I suggest you try going to that script's support site for that sort of thing.
  4. You said something is undefined, but you aren't sure what. Well the error message tells you what is undefined. It's telling that you are trying to call a function called "getpage()" but php can't find it. It doesn't exist. It's undefined. No offense, but it's not some deep rocket science mystery of the universe thing.. So, now that you know that php can't find a function called getpage(), what do you think your next step should be? If you couldn't find something, what would you do?
  5. without looking at your code, my first guess is that those files are producing a raw image output. You can do any number of things to have them on the same page. - modify the output of the files to create an image file, and then include them with html image tags - include them as iframe sources - create code to take the images and create a new, merged image.
  6. $items = array_filter($_POST['items']);
  7. So, based on the error message, what do you think the problem is?
  8. $subject = "blahblahblah"; preg_match('~^[^.]{1,100}~',$subject,$match); echo $match[0];
  9. gettext is an existing php function. rename your function.
  10. shh dun tel ne1 kk thx if peepol nowed i r 13 the demoted me lulz
  11. IfIhadagoodnamewhywhouldntIuseitformyself.com
  12. nah, in this case, I forgot to escape it. I used my superhero ability to go back in time and watched myself (not) do it.
  13. whoops, I did forget to escape the ?. Good catch! I never thought of using \K before, brilliant! Is the lookbehind assertion really more optimal, or are you just being fancy?
  14. to be fair though, regex is a big scary gray area to most programmers, even seasoned veterans.
  15. well one way to do it is the same way you have $dir in there
  16. That's how I learn, as well.
  17. that glob would return everything starting with "foo", regardless of whether it is an image, some other file, or a subdirectory. You can change it to ...glob($dir . 'foo*.jpg') to get all .jpg files starting with foo.
  18. $subject = "content to match here"; preg_match_all('~<div[^>]*id\s?=\s?["\']([^"\']+)~i',$subject,$matches); print_r($matches[1]); or as an alternative, you might want to consider using DOM
  19. LoL how about a built-in function that returns all possible part of speech for a word?
  20. personally I would do it like this: preg_match("~?>(.*)~s", $input, $out); echo $out[1]; - I would remove the "return;" to make it more generic. - I'd also use * instead of + as the quantifier in the event that there isn't anything after "?>". - I would also remove the ? to make it greedy; since you're aiming to match everything after, it would be more efficient to make the quantifier greedy. - I would remove the $ and use s modifier instead. The dot by default matches up to the end of line, so $ is not necessary. But the context of his subject implies he's looking for more than a 1-line match, so I added the 's' modifier in there to make the dot also match newline chars
  21. Well regardless of nomenclature, I think you're putting the cart before the horse. As pointed out by many people, making a single escape char auto-pluralize something is not exactly a simple task...maybe even bordering on impossible. There are many rules to follow for pluralizing something, and it may or may not be pluralized the same way, depending on context and grammar of the rest of the sentence (assuming it was even written correctly to begin with)...and then multiply that by however many languages out there.
  22. just a quick note: even though it is effectively the same thing for your purposes, \b is not quite the opposite of \w and not quite the same as \W. The difference is that \b has zero width assertion, meaning that it will not consume a character in the match, whereas \w and \W will. Not really relevant for your purposes, but thought I'd clarify that just the same...
  23. \b is shorthand for "word boundary" so it will for instance match " ass " ".ass." " ass?" but not "class" because \b will fail on that "l" because it is a word character. \b is effectively the opposite of \w and effectively the same as \W
  24. because your working script is c.php so "fourth/d.php" is indeed relative to it. edit: ah wait, a.php is your working script. But nonetheless, "../" specifically means "the directory above the working directory" so it will always be relative to the working script.
  25. You could wrap it in \b instead of \s [pre] ~\b$var\b~ [/pre]
×
×
  • 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.