Menu
Home
Recent Posts
Showing posts with label
delete element
.
Show all posts
Showing posts with label
delete element
.
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
PHP: Check if string contains specific word
You can use the strpos function which is used to find the occurrence of one string inside other: if ( strpos ( $a , 'are' ) !== ...
How to solve: Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XXX bytes)
There is not enough memory to run your script. PHP has reached the memory limit and stops executing it. This error is fatal, the script sto...
How to: Use json_encode in MySQL results
$sth = mysql_query ( "SELECT ..." ); $rows = array (); while ( $r = mysql_fetch_assoc ( $sth )) { $rows [] = $r ; } ...
How to: Preview an image before upload with jQuery
JavaScript function readURL ( input ) { if ( input . files && input . files [ 0 ]) { var reader = new FileR...
How to: Properly set up a PDO Connection
The goal As I see it, your aim in this case is twofold: create and maintain a single/reusable connection per database make sure that t...