Forum Moderators: coopster

Message Too Old, No Replies

(Easy enough) What is the right code

         

basketmen

11:06 pm on Jun 25, 2009 (gmt 0)

10+ Year Member



i have 2 php code

$this->types = array('ONE' => 'First',
'TWO' => 'Second',
'THR' => 'Third',
'FOU' => 'Fourth');

and

<?php
echo tep_get_member_name($seller_member_id);
?>

i want the Third text in color in first code is changed to second code

i had try these but still not working

$this->types = array('ONE' => 'First',
'TWO' => 'Second',
'THR' => '<?php
echo tep_get_member_name($seller_member_id);
?>
',
'FOU' => 'Fourth');

$this->types = array('ONE' => 'First',
'TWO' => 'Second',
'THR' => <?php
echo tep_get_member_name($seller_member_id);
?>
,
'FOU' => 'Fourth');

please help guys what is the right code?

jatar_k

1:02 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you can do it in two steps might be the easiest

$three = tep_get_member_name($seller_member_id);
$this->types = array('ONE' => 'First',
'TWO' => 'Second',
'THR' => $three,
'FOU' => 'Fourth');

though to put it straight in you just need to get rid of the echo and the extra php tags like so

$this->types = array('ONE' => 'First',
'TWO' => 'Second',
'THR' => tep_get_member_name($seller_member_id),
'FOU' => 'Fourth');