I have this simple function that I pass in an array of strings:
function myfunction( $arg = array() )
{
}
Simple so far, but I need some lines in the array to $argbe formatted and some to remain unformatted . I can not figure out how to do this?
Let's say I ran this $argone through myfunction():
echo myfunction( array( 'format me!', 'do not format me!' ) );
My little brain cannot figure out how to report myfunction()that the first value in the array $argshould have formatting, and it should not format the second value.
I was thinking of an associative array, but I think this may be the wrong approach due to having the same indexes.
echo myfunction( array( 'format' => 'hi', 'format' => 'bye', 'noformat' => 'foo');
Just find the “push” in the right direction.
EDIT 1:
, $arg, .
2:
$arg , .