Answers for "remove attribute from array php"

PHP
1

php remove class attribute

$html = preg_replace('/class=".*?"/', '', $html);
Posted by: Guest on June-23-2020
14

php delete element from array

//Delete array items with unset(no re-index) or array_splice(re-index)
$colors = array("red","blue","green");                             
unset($colors[1]);//remove second element, do not re-index array

$colors = array("red","blue","green");
array_splice($colors, 1, 1); //remove second element, re-index array
Posted by: Guest on August-06-2019

Code answers related to "remove attribute from array php"

Browse Popular Code Answers by Language