Answers for "extract in php"

PHP
13

strpos in php

<?php
$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);

// Note our use of ===.  Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
    echo "The string '$findme' was not found in the string '$mystring'";
} else {
    echo "The string '$findme' was found in the string '$mystring'";
    echo " and exists at position $pos";
}
?>
Posted by: Guest on March-13-2020
0

php array extract value

<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Posted by: Guest on July-29-2020
0

php extract

<?php

$a = "Original";

$my_array = array("a" => "Cat","b" => "Dog", "c" => "Horse");

extract($my_array);

echo "\$a = $a; \$b = $b; \$c = $c";

?>
Posted by: Guest on August-31-2021
0

extract in php

$arr = array('mango'=>'My favourite fruit','apple'=>'It is good for health','banana'=>'it is good for bones'); 

// it will convert array to variable 

extract($arr); 

echo $mango."</br>"; 

echo $apple."</br>"; 

echo $banana;
Posted by: Guest on September-29-2021

Browse Popular Code Answers by Language