Hi!
Eigentlich arbeitet man in Klassen nicht mit Rückgabewerten, sondern mit Objekten. Schau mal so könnte es aussehen:
PHP-Code:
<?php
class img
{
var $string = '';
// Konstruktor
function img ( $value = array() )
{
$this->erstelle_string ( $value );
}
function erstelle_string ( $value )
{
$this->string = '<img';
foreach ( $value as $key => $content )
{
// $this->content_check($content, $key);
$this->string .= ' ' . $key . '="' . $content . '"';
}
$this->string .= ' />';
}
}
$ar = array ( 'src' => '../bildname' );
$img = new img ( $ar );
print $img->string;
?>
PS: Bitte benutz die
Forums-Tags, wenn Du Code postest.