Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Check for more than 1 HTML tag with PHP

Discussion in 'Website Design Forum:' started by iEthan, Feb 27, 2009.

  1. iEthan

    iEthan Member

    So, here is my dilemma:
    I'm doing a website for a client, and she has portfolio page. She says that she will display 1-3 items there at a time. Now, I need to put in a code, that if there is more than 1 <div class="sub-container"> classes, it will need to put in <div id="line"></div>.

    Ask for clarification if you need it.

  2. Kevin

    Kevin Senior Member

    Well my PHP knowledge is very limited. But thinking logically you could add a note behind each closing div. That way the browser will know when to insert a new div. (Maybe there is a much easier way but I'm a PHP newb :cry:)

    <div id="sub-container">  Lorem ipsum.</div>[COLOR=Green]<!-- end sub -->[/COLOR]
    And then tell your PHP to insert a new div behind the comment. But I don't know how to do that exactly so if you're looking for some specific code then this post was pretty useless. :angel:
  3. Sunburn

    Sunburn Active Member

    why not use jquery or another javascript frame work to do the job for you? rather than php.
  4. Jazajay

    Jazajay Active Member

    Hay buddy what exactly are you trying to pull off as that seems a bit hard core for a CSS issue?
  5. Skipper

    Skipper Junior Member

    How is the information being outputted now? Where is it being retrieved from, like a database? Or is it just a static HTML document? (I'm guessing not, since "PHP" is in the title =P)

    Current source code would be nice, if applicable.
  6. AaronPollock

    AaronPollock Junior Member

    What he said ^^ :) If it's coming out of a database, you can just count the entries in the results array and conditionally stick in the "line" div.
  7. iEthan

    iEthan Member

    I fixed the problem. No worries!

Share This Page