Try explode instead of split

This commit is contained in:
Laurent Destailleur 2009-10-19 20:17:19 +00:00
parent 1ba947aef4
commit 1312b0d8fd
4 changed files with 10 additions and 10 deletions

View File

@ -165,10 +165,10 @@ FILE_SKIP_EMPTY_LINES);
private function translateTexts($src_texts = array(), $src_lang,
$dest_lang){
$tmp=split('_',$src_lang);
$tmp=explode('_',$src_lang);
if ($tmp[0] == $tmp[1]) $src_lang=$tmp[0];
$tmp=split('_',$dest_lang);
$tmp=explode('_',$dest_lang);
if ($tmp[0] == $tmp[1]) $dest_lang=$tmp[0];
//setting language pair

View File

@ -87,10 +87,10 @@ $formfile = new FormFile($db);
// Init $array_match_file_to_database from _SESSION
$serialized_array_match_file_to_database=isset($_SESSION["dol_array_match_file_to_database"])?$_SESSION["dol_array_match_file_to_database"]:'';
$array_match_file_to_database=array();
$fieldsarray=split(',',$serialized_array_match_file_to_database);
$fieldsarray=explode(',',$serialized_array_match_file_to_database);
foreach($fieldsarray as $elem)
{
$tabelem=split('=',$elem,2);
$tabelem=explode('=',$elem,2);
$key=$tabelem[0];
$val=$tabelem[1];
if ($key && $val)
@ -222,10 +222,10 @@ if ($step == 4 && $action == 'select_model')
if ($result > 0)
{
$serialized_array_match_file_to_database=$objimport->hexa;
$fieldsarray=split(',',$serialized_array_match_file_to_database);
$fieldsarray=explode(',',$serialized_array_match_file_to_database);
foreach($fieldsarray as $elem)
{
$tabelem=split('=',$elem);
$tabelem=explode('=',$elem);
$key=$tabelem[0];
$val=$tabelem[1];
if ($key && $val)
@ -241,7 +241,7 @@ if ($action == 'saveorder')
{
// Enregistrement de la position des champs
dol_syslog("boxorder=".$_GET['boxorder']." datatoimport=".$_GET["datatoimport"], LOG_DEBUG);
$part=split(':',$_GET['boxorder']);
$part=explode(':',$_GET['boxorder']);
$colonne=$part[0];
$list=$part[1];
dol_syslog('column='.$colonne.' list='.$list);
@ -252,7 +252,7 @@ if ($action == 'saveorder')
// Reinit match arrays. We redefine array_match_file_to_database
$serialized_array_match_file_to_database='';
$array_match_file_to_database=array();
$fieldsarray=split(',',$list);
$fieldsarray=explode(',',$list);
$pos=0;
foreach($fieldsarray as $fieldnb) // For each elem in list. fieldnb start from 1 to ...
{

View File

@ -124,7 +124,7 @@ if ($resql)
$sendto = eregi_replace(',',' ',$obj->prenom." ".$obj->nom) ." <".$obj->email.">";
// Make subtsitutions on topic and body
$other=split(';',$obj->other);
$other=explode(';',$obj->other);
$other1=$other[0];
$other2=$other[1];
$other3=$other[2];

View File

@ -77,7 +77,7 @@ foreach ($argv as $key => $value)
if (eregi('^lang=',$value))
{
$found=true;
$valarray=split('=',$value);
$valarray=explode('=',$value);
$newlangid=$valarray[1];
print 'Use language '.$newlangid.".\n";
}