There is a string
Текст текст текст № 32456
Can the number be made a link?
preg_replace
Can use regular expressions
$txt = "Текст текст текст № 32456"; $result = preg_replace("/№\s*(\d+)/", '№ <a href="#$1">$1</a>', $txt);
where $1 in the substitution is a reference to the matching group found.
$1
result:
Текст текст текст № <a href="#32456">32456</a>
Source: https://ru.stackoverflow.com/questions/826317/More articles:How to catch the event closing and opening the lid of the laptop in JavaScript?Selection from the database of PNG imagesANDROID camera related application ...?Match string with part of regular expressionAndroid and MySQL connection [closed]Configuring https in nginx without a certificateError on Android 8.0 crashesJasmine + TypeScript, I can not find the Spy class withArgs () methodHow to make ACF fields multilanguage using polylang?SynchronizationLockException Exception in AKKA.NET MailboxesAll Articles
preg_replace- And