I'd like to append an array value to the middle of a string.
I tried making the name as new variable and append the variable. I looked up various ways to grab just one value out of array, but nothing satisfied my needs.
I have this array:
$fields = array(
'name' => array(
'rule' => '/.+/',
'message' => $lang['ADMIN_STORE_NAME_VALIDATE'],
'value' => '',
'required' => TRUE
),
I want to append the store name to say, the end of this string
sprintf("A cool new store has been added please login to administrators area to approve the request")
sprintf()or you don't. I would suggest you do, sosprintf("A cool new store called %s has been added please login to administrators area to approve the request", $fields['name']['message']).