title: Using PHP array in a SQL query in Laravel 5.2
body: <p>I'm a beginner in Laravel. I have faced a issue in using a PHP array in a SQL statement. I have a array <code>$waypoints</code>and it contains names of cities.</p>
  
  <p><code>$waypoints = array("Paris", "Moscow", "London","New York");</code> </p>
  
  <p>And i want to find their corresponding city <code>id</code> by a SQL query. Code is as follow.</p>
  
  <pre><code>$cityname = $waypoints[2];
  
  $city = City::where('name', 'LIKE', "$cityname%")-&gt;firstOrFail();           
  </code></pre>
  
  <p>But this query does not get executed. But if i set a string value to variable   <code>$cityname</code> manually, it get executed. As example <code>$cityname = "London";</code>. 
   I can't figure out the issue. Help Needed.</p>