當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileHelper::arbreJson方法代碼示例

本文整理匯總了PHP中FileHelper::arbreJson方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileHelper::arbreJson方法的具體用法?PHP FileHelper::arbreJson怎麽用?PHP FileHelper::arbreJson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FileHelper的用法示例。


在下文中一共展示了FileHelper::arbreJson方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: useJson

 public static function useJson($file, $post)
 {
     header('Content-Type: text/html; charset=UTF-8');
     if (isset($file['fileimport'])) {
         $json = file_get_contents($file['fileimport']['tmp_name']);
         $json_objet = json_decode($json, true);
         $chaine = FileHelper::arbreJson($json_objet, "", "");
         $arbre = explode(";", $chaine);
         foreach ($arbre as $key => $value) {
             $arbre[$key] = substr($value, 1);
         }
         $params = array("result" => true, "arbre" => $arbre, "nameFile" => $file['fileimport']['name'], "json_origine" => $json, "choose" => $post['choose']);
         if ($post['choose'] == "modify") {
             $params['chooseMapping'] = $post['chooseMapping'];
         }
     } else {
         $params['result'] = false;
     }
     return $params;
 }
開發者ID:Koulio,項目名稱:pixelhumain,代碼行數:20,代碼來源:ImportData.php

示例2: foreach

    foreach ($arrayCSV[0] as $key => $value) {
        echo '<option value="' . $key . '">' . $value . '</option>';
    }
}
?>
			    				</select>
			    			</td>
			    			<td>
								<select id="selectLinkCollection" class="col-sm-12">
									<?php 
if ($createLink) {
    $params = array("_id" => new MongoId($idCollection));
    $fields = array("mappingFields");
    $fieldsCollection = ImportData::getMicroFormats($params, $fields);
    foreach ($fieldsCollection as $key => $value) {
        $pathMapping = FileHelper::arbreJson($value['mappingFields'], "", "");
        $arrayPathMapping = explode(";", $pathMapping);
        foreach ($arrayPathMapping as $keyPathMapping => $valuePathMapping) {
            if (!empty($valuePathMapping)) {
                echo '<option name="optionLinkCollection" value="' . $valuePathMapping . '">' . $valuePathMapping . '</option>';
            }
        }
    }
}
?>
			    				</select>
			    			</td>
			    			<td>
			    				<input type="submit" id="addMapping" class="btn btn-primary col-sm-12" value="Ajouter"/>
			    			</td>
						</tr>
開發者ID:Koulio,項目名稱:pixelhumain,代碼行數:31,代碼來源:importData.php

示例3: arbreJson

 /**
  * arbreJson
  *
  * 
  *
  * @access	public
  * @param	array	
  * @return	string
  */
 public static function arbreJson($json, $chaine, $pere)
 {
     foreach ($json as $key => $value) {
         if (is_array($value) == true) {
             $pere = $pere . "." . $key;
             $chaine = FileHelper::arbreJson($value, $chaine, $pere);
         } else {
             $chaine = $chaine . $pere . "." . $key . ";";
         }
     }
     return $chaine;
 }
開發者ID:acorbi,項目名稱:pixelhumain,代碼行數:21,代碼來源:FileHelper.php


注:本文中的FileHelper::arbreJson方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。