Jump to content

Anti-Moronic

Members
  • Posts

    571
  • Joined

  • Last visited

Everything posted by Anti-Moronic

  1. DOH. Thanks. Really should learn my array functions!
  2. I have this array: Array ( [jan] => 2 [feb] => 1 [mar] => 2 [apr] => 1 ) ..and I want to return: Array ('jan', 'mar') As in, find the 2 elements with the highest count and put them in an array. What is the simplest way to achieve this?
  3. My friend, use jQuery instead. You will have an easier time. Even if you know little about javascript - start with jQuery. learn selectors or something. We'll need to some example html for the generated rows. Are you wanting to hide this info via AJAX or just using js like a 'quick hide' feature?
  4. Good example, but the trouble with that is if the draw() number exists it will generate another draw() number without verifying if that also exists. Would be better to define the numbers and have them removed from a number map so they cannot possibly re-occur. Of course, there may also be a better way..
  5. Say I have this array: array( 0 => time 1 => time 2 => to 3 => to 4 => to 5 => fly ); and 2 variables - $occMin and $occMax as number of occurrences. If: $occMin = 2; $occMax = 3; I want to produce sorted list with most occurrences at the top: array( 0 => array('to', 3), 1 => array('time', 2) ); My face just melted at the thought of even beginning to tackle this. Is this somewhat possible? would it require a monster function or am I missing some native php functions which could lend a hand?
  6. Thanks for the response. Strip tags only removes the tags and so would leave the link text still there. I need to remove all links or tags of a certain type and their content. That is why I would remove the links and text but not remove the content within the div. Thanks.
  7. Here is the text: <div class="left">Lorem Ipsum is simply dummy text of the printing and</div> typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scramble'd it to make-shift type <a href="google.com">specimen book</a> and something [tag]else[/tag]. Essentially what I'm trying to do is extract all of the words above while abiding by these rules: 1. word can contain dash and apostrophe (scramble'd and make-shift above) 2. word cannot be within a link tag 3. word cannot be within a block tag - [tag] 4. word cannot be part of a tag name or html (class in class=", div, a, tag etc) That's about it. Any advice on where I might start with that? I'm currently experimenting with it but all I have is this: (\s?)[a-zA-Z0-9\'\-]+(\s?|\,|\.) Shameful, I know.
  8. Makes a very important point. You will have trouble finding 'advanced php' books because php itself is not that advanced of a programming language. I sometimes find myself switching off from time to time when I'm programming in php because it's so damn easy when you 'know' it. The only challenge now is keeping on top of modern web technologies. Programming in general: the rabbit hole goes very deep. Hurts my head. Oh, I'd also second that pragmatic programmer. This is one of THE best programming books I've ever read. You can see other recomendations here: http://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read Code Complete and Pragmatic Programmer! For php: Php 5 Objects Patterns and Practice by that matt guy.
  9. To be honest we can't go wrong with notepad++. Ultra fast, simple and has quite a few plugins to extend basic functionality. I can't offer an unbiased opinion as I have only used a few editors - DW, notepad++ and Zend Studio 7,8. I can't stand DW and I work with ZS on my main projects but mainly due to using Zend Framework so it all integrates very nicely. That, with project specific settings and sessions etc AND the incredibly customizable template code insertions makes it a breeze to develop in. I might move onto DW again if the next trial version impresses me.
×
×
  • 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.