Skip to content

Instantly share code, notes, and snippets.

function make_json($param) {
$array = array();
if(sizeof($param) > 0){
foreach ($param as $row) {
if ($row != "") {
array_push($array, $row);
}
}
}
return json_encode($array);
<?php
$texthtml = 'Who is Sara Bareilles on Sing Off<br>
<img alt="Sara" title="Sara" src="475993565.jpg"/><br>
<img alt="Sara" title="Sara two" src="475993434343434.jpg"/><br>';
preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', $texthtml, $image);
echo $image['src'];
?>
2147483647