Sponsored Content
Full Discussion: Basic php help
Top Forums Web Development Basic php help Post 302917994 by Corona688 on Friday 19th of September 2014 04:30:26 PM
Old 09-19-2014
Oh, I see what you mean.

You are trying to include PHP tags inside PHP tags, which isn't going to work.

Remember that PHP { } and <?php ... ?> are independent of each other though! This is valid:

Code:
<?php

for($n=0; $n < 10; $n++)
{

?>
<h3>Hello World!</h3>
<?php

}

?>

The for-loop crosses straight over outside-PHP contents ten times, effectively "printing" them ten times just because the code passed it. I don't know any other language that can do this.

You can even mix them. So you can do:

Code:
<?php if($variable) { ?>
<h3>HTML Contents <?php echo $var ?> </h3>
<?php } else { ?>
<h3>Other HTML Contents <?php echo $othervar ?></h3>
<?php } ?>


Last edited by Corona688; 09-19-2014 at 05:35 PM..
 

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Basic...

hi, I am pretty new both to unix and this forum, can anyone help me to give shortcuts to my commands... eg:- instead of "cd /usr/bin" i want to to give " bin " and get to that path. I'm using HP-UX 11.0 abey (2 Replies)
Discussion started by: abey
2 Replies

2. HP-UX

Bt-basic

Hi Guys, I very new to bt-basic even I got 8 years experience on UNIX. I searched through google about bt-basic but nothing really give me solid documentation. Anybody have documentation or manual for this bt-basic? Pls help me (2 Replies)
Discussion started by: shahru
2 Replies

3. HP-UX

to know the basic

Hi, Good morning I want to install HP-Unix in my PC. I already have windows XP home edition in my PC. I do not want remove XP,But I need HP-Unix in the same system. Is it posssible? If it is what is the name and version of HP-Unix cd? Where can I get the CD to install. I have... (4 Replies)
Discussion started by: nandhini
4 Replies

4. Shell Programming and Scripting

help on a basic example

hi, in a text file i have listed some file names, it look like this AAAA1 AAAA2 AAAA3 BBBBB1 AAAA4 BBBBB2 BBBBB3 AAAA5 AAAA6 BBBBB4 i want to make some operations on the files with name AAAAAx which is listed just before files with name BBBBBx that is: i want to select AAAA3,... (8 Replies)
Discussion started by: gfhgfnhhn
8 Replies

5. UNIX for Dummies Questions & Answers

basic if else

I know this is pretty basic, but i cant figure it out to save my life. i want it to ask for a variable, as long as that variable isnt -/0 i want it to print out the area. else if the variable is -/0, i want it to print out invalid entry. the only problem is it will still try to print out the... (1 Reply)
Discussion started by: cookiebooy
1 Replies

6. Solaris

Basic - how do I?

How do I use ls and grep together to count a certain number of files in a directory? -Thanks (1 Reply)
Discussion started by: secno
1 Replies

7. UNIX for Dummies Questions & Answers

Basic help

Hi , I need to know the difference between $((command)) and $(command) and $(($(command))). "" and '' and ``. I have tried searching the help files but cant able to find this. Could you let me knoq about any document. Thanks (4 Replies)
Discussion started by: Raj999
4 Replies

8. What is on Your Mind?

Vs basic

There isn't much of a relation between 80's BASIC and today's BASIC. A lot of languages seem similar. The BASIC I worked with was Dartmouth or VSBASIC. Now existing as ATARI BASIC. PERL and JULIA look appealing, it would be nice if there where a program like VSBASIC. 80's... (7 Replies)
Discussion started by: teak
7 Replies
COLORS(3)						   libbash colors Library Manual						 COLORS(3)

NAME
colors -- libbash library for setting tty colors. SYNOPSIS
colorSet <color> colorReset colorPrint [<indent>] <color> <text> colorPrintN [<indent>] <color> <text> DESCRIPTION
General colors is a collection of functions that make it very easy to put colored text on tty. The function list: colorSet Sets the color of the prints to the tty to COLOR colorReset Resets current tty color back to normal colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) colorPrintN The same as colorPrint, but trailing newline is added Detailed interface description follows. Available colors: Green Red Yellow White The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). FUNCTIONS DESCRIPTIONS
colorSet <color> Sets the current printing color to color. colorReset Resets current tty color back to normal. colorPrint [<indent>] <color> Prints text using the color color indented by indent (without adding a newline). Parameters: <indent> The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. <color> The color to use. <color> The text to print. colorPrintN [<indent>] <color> The same as colorPrint, except a trailing newline is added. EXAMPLES
Printing a green 'Hello World' with a newline: Using colorSet: $ colorSet green $ echo 'Hello World' $ colorReset Using colorPrint: $ colorPrint 'Hello World'; echo Using colorPrintN: $ colorPrintN 'Hello World' AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <gil@ran4.net> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy