PHP Help

by 3 replies
4
Let's say I have this code that pulls a product title from Amazon. What would I add to it to add the word "Review" after the product title?

$my_post['post_title'] = $product['title'];

Thank you in advance for your help!
#programming #php
  • $my_post['post_title']=$product['title']." Review";

    In PHP (.) is string addition as opposed to (+) which is mathematical addition.
    • [ 1 ] Thanks
  • Thank you very much!
  • You can use php syntax in many ways :

    $my_post['post_title'] = $product['title']." Review"; or
    $my_post['post_title'] = "{$product['title']} Review";

    PHP support array variables within string by using brackets "My string {$var['array']}"
    • [ 1 ] Thanks

Next Topics on Trending Feed

  • 4

    Let's say I have this code that pulls a product title from Amazon. What would I add to it to add the word "Review" after the product title? $my_post['post_title'] = $product['title'];