Skip to content

Tag: string

PHP Insert into PostgreSQL

So it’s probably a really stupid/basic question, but i have this simple PHP function (which works) and inserts data into a PostgreSQL DB. My issue is when it encounters specific data; function …

Split string by last character and save to array?

I have several strings that look like: longname1, anotherlongname2, has1numbers2init3 I would like to use str_split to split off the last character of the strings. Eg: I can get the number alone using substr($string, -1); but need to find an efficient way of retrieving the remainder of the string. I have trie…

Without Regex: String Between Quotes?

I’m creating a word-replacement script. I’ve run into a roadblock with ignoring strings between quotes and haven’t been able to find a decent solution here that didn’t involve Regex. I have a working …