更新: を私はライン67および68から$1
を削除すると、すべてのUndefienedは2つのオフセット誤差をforeachの一覧は、未定義のオフセットを返します。エラー
を行っているだけで1未定義のは1つのエラーを相殺し、それがあります「カスタム」としてXが戻ることなく、VAR
<?php list($w, $h, $1) = OX_Tools::explode_format($sformat); // Line 67?>
<option<?php echo ($adformat == $sformat ? ' selected="selected"' : ''); ?> value="<?php echo $sformat; ?>"> <?php printf($formats['formats'][$sformat], $w, $h, $1); ?></option>
// Changed to This
<?php list($w, $h) = OX_Tools::explode_format($sformat); // Line 67?>
<option<?php echo ($adformat == $sformat ? ' selected="selected"' : ''); ?> value="<?php echo $sformat; ?>"> <?php printf($formats['formats'][$sformat], $w, $h); ?></option>
私は未定義を取得し、この1 といくつかの助けが必要オフセット:1通知を値がオフセット単語「カスタム」 私は未定義を取得するとき:2ときに値はxで区切られた数値です。perform機能別編集OX_Tools::explode_format
私はこのサイトや他のサイトで数十の記事を読んでいて、私の状況ではいくつかの解決策を試してみました。この時点で何を試してみるか分からない。どんなアイデアでも大歓迎です。 explode_format
後$sformat
の
結果サンキューはの
160×600 120x600の
300×250 125×125
カスタム
結果ですエラーがここに線67上にある$formats
print_r($formats);
Array
(
[data] => Array
(
[all] => Array
(
[horizontal] => Array
(
[0] => 728x90
[1] => 468x60
)
[vertical] => Array
(
[0] => 160x600
[1] => 120x600
)
[square] => Array
(
[0] => 300x250
[1] => 125x125
)
[custom] => Array
(
[0] => custom
)
)
)
[types] => Array
(
[text] => Text ads
[image] => Image ads
[ref_text] => Text referrals
[ref_image] => Image referrals
[textimage] => Text and image ads
[link] => Ad links
[video] => Video ads
[all] => All ad types
)
[sections] => Array
(
[horizontal] => Horizontal
[vertical] => Vertical
[square] => Square
[other] => Other ad formats
[custom] => Custom width and height
)
[formats] => Array
(
[728x90] => %1$s x %2$s Leaderboard
[468x60] => %1$s x %2$s Banner
[160x600] => %1$s x %2$s Wide Skyscraper
[120x600] => %1$s x %2$s Skyscraper
[300x250] => %1$s x %2$s Medium Rectangle
[125x125] => %1$s x %2$s Button
[custom] => Custom width and height
)
)
の
print_r($sformats);
Array
(
[0] => 728x90
[1] => 468x60
)
Array
(
[0] => 728x90
[1] => 468x60
)
Array
(
[0] => 160x600
[1] => 120x600
)
Array
(
[0] => 160x600
[1] => 120x600
)
Array
(
[0] => 300x250
[1] => 125x125
)
Array
(
[0] => 300x250
[1] => 125x125
)
Array
(
[0] => custom
)
結果コード
<?php foreach ($sformats as $sformat) : ?>
<?php list($w, $h, $l) = OX_Tools::explode_format($sformat); //Line 67?>
<option<?php echo ($adformat == $sformat ? ' selected="selected"' : ''); ?> value="<?php echo $sformat; ?>"> <?php printf($formats['formats'][$sformat], $w, $h, $l); ?></option>
<?php endforeach; ?>
ここでは、機能はまあOX_Tools::explode_format
<?php
static function explode_format($format)
{
$vars = preg_split("/[x#]+/", $format);
return $vars;
}
?>
コードには意味がありません。問題の再現を試みるには、明確かつ検証可能な例を添付する必要があります。たとえば、 '$ formats ['formats'] [$ sformat]'に関連するコードを添付しないでください。定義されていないオフセットエラーがここにあると思います... –
'$ vars [0] ; '関数でエラーが消えてしまったが、htmlの出力が正しくないこれは私が編集する必要があった関数や行だったかどうかわからないという私の質問のポイントだった。 HTML結果 '<オプション値= "728"> 7×2リーダー' '<オプション値= "468"> 4×6バナー' なければならない '<オプション値= "728"> 728 ×90リーダーボード ' ' <オプション値=「468」> 468×60バナー ' ライン68を見て、私はhtml出力が正しい作るか、戻って67 – chop62
なぜあなたを見て続けることができるかどうかを確認しますpreg_splitが必要ですか?十分ではない ''爆発( "x"、$ var) '? –