0
can i remove a specific word of a string from databse with php code?
For Example : change this string "http://cdn.domin.com/dl/video.mvk" to "/dl/video.mvk"
5 ответов
+ 1
Yes you can but is the word changeable?
+ 1
So you can do as follow
$str = "link" ;
$replace ="/dl/video.mkv ";
$str = substr($str, strpos($str, $replace), strlen($replace)) ;
Then update the value in database
+ 1
thank you all
0
yes
0
UPDATE <table_name> SET <column_name> = REPLACE(<column_name>, 'http://cdn.domin.com/', '/');
Assuming <table_name> is name of the table, and <column_name> is name of the column that needs to be replaced
Try to execute this query.
Mind you though, I haven't tested the query, but I suppose you can play or tweak it in case it doesn't work 😁
* Reference:
https://www.w3resource.com/slides/mysql-string-functions.php