Sinisterly
[STAFF PLEASE DELETE THREAD] - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: PHP (https://sinister.ly/Forum-PHP)
+--- Thread: [STAFF PLEASE DELETE THREAD] (/Thread-STAFF-PLEASE-DELETE-THREAD--118458)



[STAFF PLEASE DELETE THREAD] - Tibo inc - 02-15-2020

-----------------------------------------------------


RE: PHP Code Help - mothered - 02-15-2020

Thread moved from the Coding forum, accordingly to PHP.


RE: PHP Code Help - hacxx - 02-15-2020

Use a string replacer/counter.
*********************


RE: PHP Code Help - Tibo inc - 02-15-2020

-----------------------------------------------------


RE: PHP Code Help - hacxx - 02-15-2020

I have a working snip but is in JS.


RE: PHP Code Help - Tibo inc - 02-18-2020

-----------------------------------------------------


RE: PHP Code Help - hacxx - 02-18-2020

It took a while to find because i only used once...

Code:
var parser = document.createElement('a');
parser.href = ""+ myObj.items[x].link +"";
parser.pathname;
parser.hostname;
var str = ''+parser.pathname+'';
var res = str.replace("/wws/info/", "");

I'm using str.replace, it modifies a string, in this case /wws/info/ to nothing.


RE: PHP Code Help - chunky - 03-01-2020

Take a look at the substr() function.
Code:
substr($_GET['number'], 0, 6)