Created
October 31, 2012 15:25
-
-
Save 4lb0/3987656 to your computer and use it in GitHub Desktop.
Devuelve un listado de mensajes al azar (AJAX y jQuery - Curso Educacion IT)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mensajes = array( | |
array('titulo' => 'Notificacion 1', 'mensaje' => 'Mensaje ejemplo'), | |
array('titulo' => 'Hola Mudo', 'mensaje' => 'como estas?'), | |
array('titulo' => 'Puto el que lee', 'mensaje' => 'Leiste ja!'), | |
array('titulo' => 'Ganaste', 'mensaje' => 'Un verdadero premio'), | |
array('titulo' => 'Sos el visitante numero 1000', 'mensaje' => 'No ganaste nada'), | |
); | |
shuffle($mensajes); | |
header("Content-Type: application/json; charset=utf-8"); | |
echo json_encode(array_slice($mensajes, mt_rand(0, count($mensajes)))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment