i have a situation that need to insert specific string according to specific number. for example the number is 4 and i need 4 of specific string (in this case is '?'
) like this: number 5 so $str = '?????'
. in another word i have a array like this ['first item','second item', 'third item']
. i need to count items in this array, that can accomplished by count()
and according to that number insert ?
. so the final string should be '?,?,?'
with ','
as separator.