Skip to content

Simple regex on string

I’m working on a simple mention system and in my PHP script and I need to extract client:6 from the larger text where one or more @mention like @[John Doe (#6)](client:6) will be present. Ex. This is my text how do you like it @John and do you have any thoughts @Jane In php the string will look like. an…

Code Executing on Page Load instead of OnClick

I have a code that gets executed on page load twice, despite adding the code to the ‘Click’ command. I have placed the code ‘alert(“Testing”);’ within the portion of the code pertaining to ‘click(function(evt)’ – grateful if someone can advise if I misunderstood the f…

Accessing php variable from within function scope

I have this code in a codeigniter controller that’s the beginnings of a pagination/sorting feature for a table in the view. I’m passing order_by as a query parameter and then this is part of the controller action: The problem is…I keep getting the error Undefined variable: order_by. Since I&…

Undefined Index Array

I just learning laravel and got this error calling array on route class using foreach but i got error (undefined index) Answer You’re using the wrong variable within the foreach scope. use $post[“title”] instead of $posts[“title”]

User Redirection accordingly an enum input. PHP code

I’m trying to redirect the logged-in user to a different page according to the enum input was stored at db. I was trying those lines, but it always redirects me at pro.php. How can I do this with the right way? What is the issue with the code? Here is my table definition: # Name Type Null Default 1 id