* Thus wrote gohaku:
> Hi everyone,
> I would like to know how to handle code breaks or code blocks
> that takes up more than two lines.

you just might start a war of the gods here....

> For readability, I would like to know if there is something like the 
> following:

> function input($type,$size,$name,$value)
> {
>       return "<input type=\"$type\" size=\"$size\" value=\"$value\" >>>
>                       name=\"$name\">";
> }

In general practice, and depending on how much html you're
outputing:

function input($type,$size,$name,$value) {
<?php
<input type="<php echo $type?>" size="<?php echo $size?>"
    value="<?php echo $value?>" name="<?php echo $name?>>
}

But on the other hand a different approach:

$field = array(
  'type'  => $type,
  'size'  => $size,
  'value' => $value,
  'name'  => $type,
  'id'    => $id, /* forgot this one :) */
  );

echo '<input >';
foreach($field as $name => $value ) {
  echo "$name=\"$value\"
} 
echo '>';


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to