473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Sep 12 '21 #1
1 7770
dev7060
636 Expert 512MB
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()
Sep 13 '21 #2

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

Similar topics

3
by: delusion7 | last post by:
I am getting this error "Undefined offset: 9 in C:\Course Technology\1687-5\Chapter.10\UpdateContactInfo.php on line 36" this is the code I am recieving the error on: if...
6
by: nicy12 | last post by:
Hi! my name is Peter. iam working on the php platform. while trying to run and compile a program i get the undefined offset error iam nto much familiar with this error . Please help me . Thanks in...
9
by: simple12 | last post by:
Hello I have a script which have the facility of entering any code to some part of a webpage. I have some problems with it. When i put some code in the script then their is no error shown. When i...
6
by: tbebest | last post by:
Hi , i have a form and it has A problem: i upload my 3 image and it uploaded in definded path but in insert in db filed there are empty: Notice: Undefined offset: 0 in C:\wamp\www Notice:...
4
by: Kevon | last post by:
Hello, I'm designing a photo gallery for my website, I've followed several tutorials online about how to go about doing this, with great success, I have come up with a set of codes, however I keep...
7
by: Neha Parihar | last post by:
hello all.. I am using luminous php syntax highlighter in my codeigniter project. It is working i.e. it highlights the codes. But an error also encountered -- A PHP Error was encountered...
1
by: Mayuri30 | last post by:
echo"Array is".print_r($arr,true);
1
by: Essiej | last post by:
Hi, I'm getting the error: undefined offset 1 on line 5 of cart.tpl and undefined offset 2 on line 6 of cart.tpl. The lines in this file are: 1 <?php 2
8
by: parul sinha | last post by:
whenever i am entering the quantity of item i got error undefined offset. i am sending my full code:- this is so.php for shopping cart:- <html> <center><table width="100%" height="300">...
0
by: mayday | last post by:
this code runs a para type multi choice question.there is 3 question with 4 options each. if we select all three uestion's answer then there is no error. if select only one question's answer...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.