在我的数据库表我有一个列有这个数据
background: linear-gradient(top , rgb(255,104,0) 0% , rgb(255,68,0) 100%);
background: -o-linear-gradient(top , rgb(255,104,0) 0% , rgb(255,68,0) 100%);
background: -ms-linear-gradient(top , rgb(255,104,0) 0% , rgb(255,68,0) 100%);
background: -moz-linear-gradient(top , rgb(255,104,0) 0% , rgb(255,68,0) 100%);
background: -webkit-linear-gradient(top , rgb(255,104,0) 0% , rgb(255,68,0) 100%);
从这里我只想要rgb值,如
rgb(255, 104, 0) 0% and rgb(255,68,0) 100%
我用普通的PHP写代码,像这样
SELECT *
FROM dt_site_settings
WHERE NOT (
Button_Gradient_Background_Color LIKE '%rgb%')
,但它不能正常工作,我想在编码模型。
我该怎么做呢?
Check This它是在核心PHP
<?php
$color= "rgb(255,104,0)";
$query = mysql_query("SELECT * FROM `dt_site_settings` WHERE Button_Gradient_Background_Color like '%$color%'");
$data = mysql_fetch_array($query);
$find = $data['Button_Gradient_Background_Color'];
$ex = explode(',',$find);
$first_color = $ex[1].','.$ex[2].','.$ex[3];
$second_color = $ex[4].','.$ex[5].','.$ex[6];
echo '<br>'.$first_color .'<br>';
echo '<br>'.$second_color .'<br>';
?>