469,156 Members | 2,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,156 developers. It's quick & easy.

indexing php error, undefined offset

2
Errors:
Notice: Undefined offset: 2 in short_codes_functions.php on line 132
Notice: Undefined offset: 3 in short_codes_functions.php on line 132

code line from 128 to 139

if (!function_exists('adforest_extarct_link')) {

function adforest_extarct_link($string) {
$arr = explode('|', $string);
list($url, $title, $target, $rel) = $arr;
$rel = urldecode(adforest_themeGetExplode($rel, ':', '1'));
$url = urldecode(adforest_themeGetExplode($url, ':', '1'));
$title = urldecode(adforest_themeGetExplode($title, ':', '1'));
$target = urldecode(adforest_themeGetExplode($target, ':', '1'));
return array("url" => $url, "title" => $title, "target" => $target, "rel" => $rel);
}
}

please solve any one as soon as possible
thank you
2 Weeks Ago #1
1 5375
dev7060
489 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. list($url, $title, $target, $rel) = $arr;
list expects aleast 4 parameters.

Expand|Select|Wrap|Line Numbers
  1. $arr = explode('|', $string);
Right side is returning an array of less than 4 values.

Either ensure explode('|', $string) returns the minimum required number of values or pad the array to the required length using array_pad()
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by delusion7 | last post: by
9 posts views Thread by simple12 | last post: by
4 posts views Thread by Kevon | last post: by
7 posts views Thread by Neha Parihar | last post: by
1 post views Thread by Mayuri30 | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.