خانه 6 Forums طرف سرور جایگزینی پارامترها در رشته

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #306

    کاربران عزیز،
    من آرایه ای مثل این دارم:

    $par['quantity'] = '10';
    $par['sender'] = 'Peter';
    $par['date'] = '12/12/2012';
    

    و رشته هایی مثل این:

    $str = ‘{$sender} sent you {$quantity} objects on {$date}’;
    I want to replace every {$variable} with $par[‘variable’]
    I know I have to use preg_replace()

    چگونه می توانم انجام دهم؟
    سپاس

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.