How do I remove http, https and slash from user input in php

后端 未结 10 2075
不思量自难忘°
不思量自难忘° 2020-11-29 04:30

Example user input

http://domain.com/
http://domain.com/topic/
http://domain.com/topic/cars/
http://www.domain.com/topic/questions/

I want

10条回答
  •  清酒与你
    2020-11-29 04:54

    if its the first characters in the string you can use substr(0,8) , and it will remove the first 8th character if its not use the "str_replace()" function http://php.net/manual/en/function.str-replace.php

提交回复
热议问题