0

as i have array like

  $array[selfintro,1]=[selfintroduction]]
  $array[experience,2]=[Experience]
  $array[education,3] =[Education]
  $array[skills,4]= [Skills]

  $model[]=[Education,selfintroduction,accomplishment]

i wanna sort "array" using "model" array so it would be like,

$array[education,3] =[Education]
$array[selfintro,1]=[selfintroduction]]

i tried to sort it using this technique,

$sorted=array_intersect($model,$array);`

it do not sort it but when i do it using normal array ahving index value then it give me its result but by using $array its index value in string and int formamt not working for me ?

hopes for your suggestions,

EDITED::

i am populating array from mysqldb and this array contain data like i mentioned above

for loop
{
$array[$templateName.','.$inc]=$V_temptag;
}

after creating this array i sort it using another array that is $model

$sorted=array_intersect($model,$array);
print_r($sorted);
Syed Raza
  • 331
  • 2
  • 13
  • 35
  • strange way to define an array ? also Question title is ambiguous – xkeshav Aug 09 '12 at 06:37
  • You want to sort it or rearrange it customly? And what is that code you provided? – Peon Aug 09 '12 at 06:38
  • Please post the right php code. – xdazz Aug 09 '12 at 06:42
  • @all perhaps code have error but its index and values are same i am just telling you what i want to do and whats actually doing you all people are well aware of declaring array hopes for your suggestions – Syed Raza Aug 09 '12 at 06:50
  • Since this is not valid PHP code by any stretch, it's hard to understand what you're really asking for. Please provide an *actual* sample. – deceze Aug 09 '12 at 07:04
  • put print_r or var_dump of your array created. so that we come to know what is the structure of array.Either your presentation is wrong or something else – Poonam Aug 09 '12 at 09:32

0 Answers0