Conversion C++ -> PHP

Résolu
TucSky Messages postés 32 Date d'inscription   Statut Membre Dernière intervention   -  
TucSky Messages postés 32 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

Je cherche à réécrire cette fonction (c++) en php :
meko_init (gint width, gint height) {
  gint i;

  meko_table = (meko_cell_t*)g_malloc( sizeof(meko_cell_t) * width * height );
  meko_width  = width;
  meko_height = height;
  for( i = 0; i < width * height; i++ ){
    meko_table[i].n   = i;
    meko_table[i].key = meko_key[i];
  }
  qsort( meko_table, width * height, sizeof(meko_cell_t), meko_compare ); //sort table
}


Le problème c'est que je ne trouve pas d'équivalent de la fonction c++ "qsort" en php.
Des conseils ?

Merci d'avance
A voir également:

2 réponses

ThEBiShOp Messages postés 8411 Date d'inscription   Statut Contributeur Dernière intervention   1 566
 
Salut,

tu trouveras là https://www.php.net/manual/fr/array.sorting.php les différents tris sur un tableau
0
TucSky Messages postés 32 Date d'inscription   Statut Membre Dernière intervention   1
 
Merci ça doit donc être uksort
0