Menu
Home
Recent Posts
Showing posts with label
unset
.
Show all posts
Showing posts with label
unset
.
Show all posts
How to: Delete an element from Array PHP
8:24 AM
0
Share
You can use
unset
<?
php $x
=
array
(
1
,
2
);
unset
(
$x
[
0
]);
var_dump
(
$x
);
?>
This is the output:
array
(
1
)
{
[
1
]=>
int
(
2
)
}
Read More
Older Posts
Home
Subscribe to:
Comments (Atom)
Development and programming answers
Search articles
Popular Posts
How to: Calculate the difference between 2 dates in PHP
Input: Start Date : 2007 - 03 - 24 End Date : 2009 - 06 - 26 Output: 2 years , 3 months and 2 days Use strtotime() to conve...
How to: Get thumbnail from YouTube video API from PHP and cURL
Each YouTube video has 4 generated images. They are predictably formatted as follows: http : //img.youtube.com/vi/<insert-youtube-video...
How to access PHP variables in JavaScript or jQuery
To have access to PHP variables in JavaScript or jQuerys sometimes you have to write something like this: <? php echo $variable1 ?> ...
How to solve: Parse error: syntax error, unexpected '['
This error comes in two variatians: Variation 1 $arr = [ 1 , 2 , 3 ]; This array initializer syntax was only introduced in PHP 5.4;...
How to solve: Warning: [function] expects parameter 1 to be resource, boolean given
Resources are a type in PHP (like strings, integers or objects). A resource is an opaque blob with no inherently meaningful value of its own...