Je veux appuyer sur la touche et de la valeur dans le tableau, mais je ne peux pasarray_push key => value, comment le faire?
$con = mysqli_connect('localhost','root','','wp') or die (mysqli_error('Error:'));
$query = mysqli_query($con,'set names utf8')or die (mysql_error());
$qy = mysqli_query($con,"SELECT ID,post_title FROM wp_posts WHERE post_type='page' AND post_status='publish'")or die (mysql_error());
$arr = array();
while ($row = mysqli_fetch_array($qy)){
$id = "?page_id=".$row['ID'];
$title = $row['post_title'];
$arr[] = $id . "=>" . $title;
array_push($arr, "$id" => "$title");
}
plz help me ..
merci^_^
duplication possible de [Using array_push() pour ajouter des éléments à un tableau sous la forme 'key => object'] (http://stackoverflow.com/questions/4772314/using-array-push-to-add -elements-à-un-tableau-dans-la-forme-de-clé-objet) –