I am grabbing from a MySQL database some fields and putting them into an array. Here is the code:
$dataArray = array();
$query_url = "SELECT * FROM videos";
$query_exec = mysql_query($query_url) or die();
while($res = mysql_fetch_array($query_exec)) {
echo $dataArray[$res['id']] = $res['video'];
echo "<br />";
}
With this I have the printed list of youtube videos taken from my "videos" table, I am trying to get only the last shortcode of youtube, for example: Here is the youtube link: http://www.youtube.com/watch?v=sN8grtFUQYs I want to get only the: sN8grtFUQYs
How can I get them from an array that gets the data from a MySQL database automatically?