Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2010, 12:29
sharlymart
 
Fecha de Ingreso: abril-2010
Ubicación: Mexico
Mensajes: 35
Antigüedad: 14 años
Puntos: 0
Pregunta Como dividir el contenido de una variable en 2 ??

hola amigos me urge dividir el contenido de una variable en 2 variables.
realizo mi consulta hago un arreglo :
Código PHP:
Ver original
  1. $datos="select  NomEntCom,TblEntCom.CveEntCom,CVeCtrEsc,CveEntGpo, TblEntInt.CveEntInt,NomEntInt,ApsEntInt, TblPerCom.NivPerCom,FchEntCom, count(*) from TblOrgCom, TblPerCom, TblEntInt, TblEntCom left join TblComInt on TblEntCom.CveEntCom=TblComInt.CveEntCom where TblComInt.CveEntPrf=4 and TblOrgCom.PlnEstCom='Licenciatura en Informática Administrativa' and TblEntCom.CveEntCom=TblOrgCom.CveEntCom and TblEntCom.CveEntCom=TblPerCom.CveEntCom and TblEntInt.CveEntInt=TblComInt.CveEntInt group by TblEntCom.CveEntCom order by TblPerCom.NivPerCom";
  2.  
  3. $result = mysql_query($datos) or die(mysql_error());
  4. $i=0;
  5.  while ($registro = mysql_fetch_array($result)){
  6.  
  7.  $NombreMateria[$i] = $registro ['NomEntCom'];
  8.  $ClaveMateria[$i] = $registro ['CveEntCom'];
  9.  $NivelMateria[$i] = $registro ['NivPerCom'];
  10.  $FechaMateria[$i] = $registro ['FchEntCom'];
  11.  $ContRegistros[$i] = $registro ['count(*)'];
  12.  $ClvControl[$i] = $registro ['CVeCtrEsc'];
  13.  $ClaveGrupo[$i] = $registro ['CveEntGpo'];
  14.  $Plantel[$i] = $registro ['PlnEstCom'];
  15.  $NomAsesor[$i] = $registro ['NomEntInt'];
  16.  $AppeAsesor[$i] = $registro ['ApsEntInt'];
  17.  $CorreoAsesor[$i] = $registro ['CorEntInt'];
  18.   $i++;
  19. }

la varible k nesesito dividir es: $ClvControl[$i] ya que esta variable con un echo me da el valor de: L00030-2010A y yo kiero en una variable el L00030 y en otra el 2010A

cabe mencionar que $ClvControl[$i] no es de un solo registro hay cientos de registros ..

ayudaaaaaaaaaaaa