• Resolved HopefulGJL

    (@hopefulgjl)


    Hi,

    I’m new to code, so I have a question to see if a code I have can be altered.

    This code is working perfectly for me, but I would like to incorporate one more piece to it, which I will explain below:

    <?php
    	$file  = "/home/public_html/path/to/random-quotes.txt";
    	$quote = file($file);
    	echo $quote[array_rand($quote)];
    ?>

    Is there a way to take that code and somehow add that I always want it to be at least 275px in height regardless of how short/long the quote actually is?

    Thanks in advance for your assistance!

Viewing 1 replies (of 1 total)
  • Thread Starter HopefulGJL

    (@hopefulgjl)

    I’ve got it!

    <center><?php
            ?><div style="min-height: 320px; padding-top: 20px; padding-left: 20px; padding-right: 30px;">
            <?php
    	$file  = "/home/public_html/path/to/random-quotes.txt";
    	$quote = file($file);
    	echo $quote[array_rand($quote)];
    ?></div></center>

    As you can see, I added more than just the height.

    Whether or not this is considered “right” or “proper” use is beside the point for me; the main point is that this is working and doing exactly what I want it to do.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Add height Code to this PHP code?’ is closed to new replies.