本文整理汇总了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;
}
示例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>
示例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;
}